1

This pattern:

pattern:  /Messages/.{_format}

Not working when i go to url /Messages

I want to redirect me to the /Messages/ like without the {_format} at the end of the pattern.

HOW?

4

1 回答 1

6

它不起作用,因为/Messages您正在调用未定义的模式。我想问题出在/.. 相反,你应该尝试这样的事情:

messages_show:
    pattern:  /Messages.{_format}
    defaults: { _controller: AcmeDemoBundle:Messages:show, _format: html }
requirements:
    _format:  html|rss

顺便提一句。当前 Symfony2 路由文档:http ://symfony.com/doc/current/book/routing.html

于 2013-03-19T21:54:13.803 回答