Philcodes
Philcodes

Reputation: 23

Invalid YAML Symfony4

am currently on symfony4 and I have this error

error

my routes

 property.show:
  path: /biens/{slug}-{id}
  controller: App\Controller\PropertyController::show
  requirements:
    id: "\d+"
    slug: "[a-z0-9\-]*"

Upvotes: 0

Views: 68

Answers (1)

Rmy5
Rmy5

Reputation: 577

The regex escaping isn't right, try this:

property.show: 
  controller: "App\\Controller\\PropertyController::show"
  path: "/biens/{slug}-{id}"
  requirements: 
    id: \d+
    slug: "[a-z0-9\\-]*"

Upvotes: 2

Related Questions