Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
This repository was 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

@geerteltink

Description

@geerteltink

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions