theq86 / zf3-twig
Twig integration for Zend Framework 3 MVC Layer
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 690
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
Requires
- php: ^7.0
- twig/twig: ^2.4
- zendframework/zend-mvc: ^3.0.1
This package is not auto-updated.
Last update: 2020-05-27 10:31:15 UTC
README
Twig integration for Zend Framework 3 MVC Layer
Installation:
composer require theq86/zf3-twig:^0.2
How to use (Quickstart)
- Add 'TwigModule' to modules.config.php
return [
'Zend\Router',
'Zend\Validator',
'Application',
'TwigModule',
];
- Add TwigStrategy to the ViewManager
'view_manager' => [
[...]
'strategies' => [
'TwigStrategy'
],
[...]
],
- In your Controller action, return an instance of TwigModel
public function twigAction()
{
return new TwigModel([
'test' => 'Welt'
]);
}
- In your view directory, add view script with .html.twig Extension