5ichong / yaf-twig
Yaf framework using Twig is template engine
Installs: 2 745
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- ext-yaf: ^3.0
- twig/twig: *
Requires (Dev)
- phpunit/phpunit: ^6.2
This package is not auto-updated.
Last update: 2025-01-27 13:39:21 UTC
README
Yaf using Twig is template engine
Installation
To install Validator, simply:
$ composer require 5ichong/yaf-twig
For latest commit version:
$ composer require 5ichong/yaf-twig @dev
Requirements
Validator works with 7.0, 7.1.
Quick Start and Examples
Add to application.ini
:
[product] application.view.ext = html [devel : product] application.twig.debug = true
Add to index.php
:
require __DIR__ . '/vendor/autoload.php';
Add to Bootstrap.php
use Yaf\Application; use Yaf\Dispatcher; public function _initView(Dispatcher $dispatcher) { $conf = Application::app()->getConfig(); $options = !empty($conf->twig) ? $conf->twig->toArray() : []; $twig = new \Aichong\Twig(APP_PATH . "/views/", $options); $dispatcher->setView($twig); }