Monday, November 1, 2010

Solution: route has some missing mandatory parameters

This time I encountered an error in symfony, I set a new route and got this error.
The route is like this:

new_page:
  url: /new/page/:id
  param: {module: page, action: new}
  requirements:
    id: \d+

How to fix?
1. Add a default value.


new_page:
  url: /new/page/:id
  param: {module: page, action: new, id: 0}
  requirements:
    id: \d+


2. Check if you used any routing functions like url_for2() that missing the input parameter.