Closed hikaru-shindo closed 12 years ago
I agree that would be an interesting feature to have. However the problem that I see is that these couple other classes that depend on the Renderer class, like the helper classes. These classes when used in the layout and views would expect an instance of the Renderer class specific to the template engine in which they are used, but since we can't really reset all the Renderer instances for each helper (or any other class that uses it) it can make writing complex ZF2 applications confusing.
I can try and see if I can find a way to not fall in the case above.
In the meanwhile you could convert the ZfcUser views from php to twig and use a module like ZeTheme(https://github.com/ZendExperts/ZeTheme) to overwrite the views from the user module.
I've managed to get the ZfcUser working with ZfcTWig by simply dropping the zfc-user templates in .twig format in the Application (or other) module's view folder.
This is also described in the Wiki https://github.com/ZF-Commons/ZfcUser/wiki/How-to-override-built-in-view-scripts
It's not like I didn't manage to override the templates using twig versions.
It's just inconvinient to need to override any templates of third party modules which do not use twig, so it would be nice if the twig renderer could fallback to the default renderer a module may defines.
Problems with overriding that come to my mind:
There may be some more points which would support the feature of allowing different renderes too which I may forgot.
This should provide you with what you need: https://github.com/ZF-Commons/ZfcTwig/pull/11
At the moment it is not possible to have twig views and still use modules utilizing the PhpRenderer.
This is a crucial point because it is not practical to either rewrite every php view in these modules to twig nor to not use PhpRenderer based modules.
I may miss something but the documentation does not point out how to get this to work.
It should be possible to use a twig layout and still utilize other view strategies in some modules. I think this is a crucial feature to add, so ZfcTwig can become usable.
I encountered this behaviour using a skeleton application, adding ZfcTwig and ZfcUser and configuring both according to the docs.