url_for or link_to in backend with admin generator Symfony
in backend_dev i generated with admin generator module News:
local开发者_StackOverflow社区host/backend_dev.php/news/2/edit
this is link for edit News ID 2. How can i generate this link for other ID?
url_for('news/edit?id=2')
doesnt work, output is:
localhost/backend_dev.php/news/edit/action?id=1
In routing i have only:
news:
class: sfDoctrineRouteCollection
options:
model: News
module: News
prefix_path: /news
column: news_id
with_wildcard_routes: true
Your route has defined the identifier column as news_id
, so try changing your url creation to
url_for('news/edit?news_id=2')
精彩评论