Skip to content

Instantly share code, notes, and snippets.

@jmikola
Created December 2, 2010 23:11
Show Gist options
  • Select an option

  • Save jmikola/726295 to your computer and use it in GitHub Desktop.

Select an option

Save jmikola/726295 to your computer and use it in GitHub Desktop.
Symfony 2 routing bugs
_view.router.generate('check')
check:
pattern: /check.:_format
defaults: { _controller: Bundle:Module:check, _format: json }
requirements: { _format: json }
route gets generated without ".json" at the end, defaults are ignored
See UrlGenerator::doGenerate()
module_view:
pattern: /path/:slug
defaults: { _controller: Bundle:Module:view, slug: ~ }
options: { segment_separators: [/] }
Should be able to access /path or /path/foo with this single routing rule; segment separator should be stripped automatically when matching or generating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment