Hi again,
You need to add the format bit in your 'pattern' line :
hello:
pattern: /hello/:name.:_format
defaults:
_controller: HelloBundle:Hello:index
requirements:
_format: html|xml|json
On Jan 6, 2:43 pm, Yan <[email protected]> wrote:
> Thanks for your reply.
>
> ../hello/Fabien, will fetch the default index.twig
> Hello: Fabien!
>
> ../hello/Fabien.xml,
> will fetch index.xml.twig
>
> The format selector seems not work.
>
> On Jan 6, 9:03 pm, mwsaz <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > According to your 'pattern:' line, the correct url is /hello/Fabien
> > (without the .xml).
>
> > On 6 jan, 00:58, Yan <[email protected]> wrote:
>
> > > Following the guide,
> > > I am using sandbox pr4
> > > in routing.yaml:
>
> > > hello:
> > > pattern: /hello/:name
> > > defaults: { _controller: HelloBundle:Hello:index, _format: xml}
>
> > > It fatches the index.xml.twig
>
> > > Set the routing.yaml to
>
> > > hello:
> > > pattern: /hello/:name
> > > defaults: { _controller: HelloBundle:Hello:index, _format: html}
> > > requirements: { _format: (html|xml|json) }
>
> > >http://localhost/sandbox/web/app_dev.php/hello/Fabien.xml
> > > Returns:
> > > Unable to find the controller.
> > > 404 Not Found - NotFoundHttpException
>
> > > In the log, find this errors:
> > > ERR No route found for /hello/Fabien.xml
> > > ERR Unable to look for the controller as the "_controller" parameter
> > > is missing
> > > ERR Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
> > > Unable to find the controller. (uncaught exception)
>
> > > Thanks for help.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en