php - Routing in Symfony2 -


how setup default routing in symfony2?

in symfony1 looked this:

homepage:   url:   /   param: { module: default, action: index }  default_symfony:   url:   /symfony/:action/...   param: { module: default }  default_index:   url:   /:module   param: { action: index }  default:   url:   /:module/:action/... 

i looking through cookbook answer this, , think i've found here. default, route parameters have hidden requirement match character except / character ([^/]+), behaviour can overridden requirements keyword, forcing match any character.

the following should create default route catches others - , such, should come last in routing config, following routes never match. ensure matches "/" well, default value url parameter included.

default_route:     pattern: /{url}     defaults: { _controller: acmebundle:default:index, url: "index" }     requirements:         url: ".+" 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -