Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foo:
- pattern: /foo/{bar}/{car}
- defaults:
- bar: barValue
- car: carValue
- Generate a route in a controller:
- $this->get('router')->generate('foo', array('bar' => 'barValue', 'car' => 'somethingElse');
- In your scenario where a default value is hidden from the url 'barValue' would NOT be added to the url because it matches the default value so the generated url would be: /foo/somethingElse
- Now if someone clicked that link and requested /foo/somethingElse and it happened to match the foo route then it would be the equivalent of /foo/somethingElse/carValue
- The bar and car param has been mixed up.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement