vinyvicente / phalcon-twig
Twig View Handler to Phalcon PHP
Installs: 317
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 4
Open Issues: 0
pkg:composer/vinyvicente/phalcon-twig
Requires
- php: >=7.1.3
- twig/twig: ^1.28 || ~2.0
Requires (Dev)
- phalcon/ide-stubs: ^3.3
This package is auto-updated.
Last update: 2025-09-23 22:34:53 UTC
README
Requirements
PHP >= 5.6
Phalcon >= 3.x
Install
composer require vinyvicente/phalcon-twig
Configuration
- Register in your DI configuration view, registering new view engine.
$di = new \Phalcon\Di\FactoryDefault(); $di['view'] = function () { $view = new View(); $view->setViewsDir('app/views/'); $view->registerEngines([ View\Engine\Twig::DEFAULT_EXTENSION => function ($view, $di) { return new View\Engine\Twig($view, $di, [ 'cache' => __DIR__ . '/app/cache/', ]); } ]); return $view; };
Important
See Twig Docs: http://twig.sensiolabs.org/documentation
Enjoy!