Question

in backend_dev i generated with admin generator module News:

localhost/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 
Was it helpful?

Solution

Your route has defined the identifier column as news_id, so try changing your url creation to

url_for('news/edit?news_id=2')

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top