symfony routing, getting the param right!
Wednesday, April 16th, 2008Weird one this, or so I thought.
Search functionality on “acme video website” was throwing up some odd errors.
View:
echo form_tag('/search');
Routing:
search:
url: /search/*
params: { module: video, action: search }
Performing a search, well, It didn’t break, but it went to:
http://www.acmevideowebsite.com/frontend_dev.php/search/module/search/action/index
all together now, “wtf?”
So, tried referencing the route with @
echo form_tag('@search');
Same result, so checking the generated HTML, we see…
action="/frontend_dev.php/search/module/default/action/index"
We now cross over live to the MSN conversation with Rob:
Baj:// says:
search:
url: /search/*
params: { module: video, action: search }
Baj:// says:
params:? or param:
Rob says:
lol
Grr, as usually with my coding, it’s something stupid… what confused me most was that it didn’t error on an incorrectly configured YAML file… probably because params: could be a legal term?
Anyway, back to work!
Newsvine
Email This to a Friend
Subscribe
