开发者

second parameter in Symfony routing

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)), or url_for('@job_show_user?id=2'), but you probably be asked to provide the other parameters too...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜