FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 703 forks source link

"engine" parameter of the View annotation is ignored #157

Closed arnaud-lb closed 12 years ago

arnaud-lb commented 12 years ago

It seems that setting the engine parameter of the View annotation has not effect:

@View(engine="haml")

Result:

Unable to find template "FooBundle:Default:index.html.twig".

FOSRestBundle expects FrameworkExtraBundle to guess the template name and engine. However, in the ViewResponseListener, the 'engine' parameter of the TemplateReference created by FrameworkExtraBundle is set to null:

https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/EventListener/ViewResponseListener.php#L115

Removing this line seems to fix the problem. Am I doing something wrong ? Is this the correct way to change the templating engine ?

lsmith77 commented 12 years ago

i think this may indeed be a left over that should be removed. can you send a PR?

arnaud-lb commented 12 years ago

Sure: https://github.com/FriendsOfSymfony/FOSRestBundle/pull/158