suin/php-yaf-twig
Composer 安装命令:
composer require suin/php-yaf-twig
包简介
Twig extension for Yet Another Framework.
README 文档
README
Twig extension for Yet Another Framework.
Installation
You can install via Composer.
At first create composer.json file:
{
"require": {
"suin/php-yaf-twig": ">=1.0"
}
}
Run composer to install.
$ composer install
Finally, include vendor/autoload.php at index.php
require_once 'vendor/autoload.php';
Add to Bootstrap.php:
<?php use \Suin\Yaf\Twig\Twig; class Bootstrap extends Yaf_Bootstrap_Abstract { /** * @param Yaf_Dispatcher $dispatcher */ protected function _initTwig(Yaf_Dispatcher $dispatcher) { $config = Yaf_Application::app()->getConfig() $dispatcher->setView(new Twig(APP_PATH.'views', $config->twig->toArray())); } }
Add to application.ini:
[product] ;app application.view.ext = twig ;twig twig.cache = APP_PATH "../cache" [devel : product] ;twig twig.debug = true
License
MIT license
统计信息
- 总下载量: 173
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-08-25