Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinyvicente/phalcon-twig
Twig Template Engine to Phalcon PHP
https://github.com/vinyvicente/phalcon-twig
miscellaneous phalcon-template phalcon-twig template-engine twig
Last synced: about 1 month ago
JSON representation
Twig Template Engine to Phalcon PHP
- Host: GitHub
- URL: https://github.com/vinyvicente/phalcon-twig
- Owner: vinyvicente
- License: mit
- Created: 2016-12-02T17:54:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-23T18:00:28.000Z (about 1 year ago)
- Last Synced: 2024-08-04T01:05:58.626Z (3 months ago)
- Topics: miscellaneous, phalcon-template, phalcon-twig, template-engine, twig
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-phalcon - twig-phalcon - Twig Template Engine for Phalcon Framework (Templating)
README
# phalcon-twig
[![Latest Stable Version](https://poser.pugx.org/vinyvicente/phalcon-twig/v/stable)](https://packagist.org/packages/vinyvicente/phalcon-twig)
[![Total Downloads](https://poser.pugx.org/vinyvicente/phalcon-twig/downloads)](https://packagist.org/packages/vinyvicente/phalcon-twig)
[![License](https://poser.pugx.org/vinyvicente/phalcon-twig/license)](https://packagist.org/packages/vinyvicente/phalcon-twig)
[![Monthly Downloads](https://poser.pugx.org/vinyvicente/phalcon-twig/d/monthly)](https://packagist.org/packages/vinyvicente/phalcon-twig)
[![Daily Downloads](https://poser.pugx.org/vinyvicente/phalcon-twig/d/daily)](https://packagist.org/packages/vinyvicente/phalcon-twig)
[![composer.lock](https://poser.pugx.org/vinyvicente/phalcon-twig/composerlock)](https://packagist.org/packages/vinyvicente/phalcon-twig)## Requirements
PHP >= 5.6
Phalcon >= 3.x## Install
```
composer require vinyvicente/phalcon-twig
```### Configuration
* Register in your DI configuration view, registering new view engine.
```php
$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!