Symfony multiple routes pointing to the same action -
my symfony app has existing route, log/add
calls function addaction
successfully.
recently i've had add variant of route has timestamp @ end so, log/add/1429228800
. need second route point @ same action first.
my issue second route generates following error:
no route found "get /log/add/1429228800"
my routes set in yml following:
log_add: pattern: /log/add defaults: { _controller: mybundle:default:add } log_add_timestamped: pattern: /log/add/{timestamp} defaults: { _controller: mybundle:default:add }
you need 1 route
log_add: pattern: /log/add/{timestamp} defaults: { _controller: mybundle:default:add, timestamp: null}
set default value timestamp parameter (null
in example, can set else)
Comments
Post a Comment