5ichong/yaf-twig

Yaf framework using Twig is template engine

v0.0.1 2017-06-21 07:32 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);
}