job_show_user:
url: /job/:company/:location/:id/:position
class: sfDoctrineRoute
options: { model: JobeetJob, type: object }
param: { module: job, action: show }
requirements:
id: \d+
sf_method: [get]
in template i use:
url_for('job_show_user', $job)
earlier (without routing) i used
url_for('job/show?id=', $id)
how can i make this in routing?
i dont have $job, but i know $id – where this i must redirect.
if i use
url_for('job_show_user', 2)
then i have error – second parameter must be array.
You should try
url_for('job_show_user', array('id' => 2)), orurl_for('@job_show_user?id=2'), but you probably be asked to provide the other parameters too…