Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Templating is not working out of the box with the default classes #122

Closed
geerteltink opened this issue Sep 5, 2015 · 0 comments
Closed

Comments

@geerteltink
Copy link
Member

As mentioned on IRC, I can't get any of the template engines working with this configuration:

'invokables' => [
    Zend\Expressive\Template\TemplateInterface::class => Zend\Expressive\Template\<engine-name>::class,
],
'factories' => [
    'Zend\Expressive\FinalHandler' => Zend\Expressive\Container\TemplatedErrorHandlerFactory::class,
],

Mostly it's issues with finding the templates I think. The easiest way was to create factories for Twig, zend-view and plates and add a unified configuration. With factories I'm also able to inject extensions easily to add basic function like constructing named routes.

My solutions are here: https://github.com/xtreamwayz/expressive-composer-installer/tree/master/src/App/Template

I had a hard time figuring out how to get zend-view working. It heavily depends on other components from zend framework. I don't think it is working with other containers than zend-servicemanager, but I can't test that until I've got the other containers working. Besides that some plugins need to be hooked up with other services, like Zend\View\Helper\Url with the router.

weierophinney added a commit to weierophinney/zend-expressive that referenced this issue Sep 10, 2015
This patch imports the factories introduced at:

- https://github.com/xtreamwayz/expressive-composer-installer/tree/master/src/App/Template

for each of Twig, Plates, and ZendView, with modifications (particularly the
lack of default template paths). Additionally, unit tests have been added to
verify behavior of each container.

The Twig support now includes the TwigExtension, which overrides the path and
asset twig helpers in order to delegate to zend-expressive functionality.
weierophinney added a commit to weierophinney/zend-expressive that referenced this issue Sep 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant