Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Twig extension for Yet Another Framework.
PHP
Branch: master
Failed to load latest commit information.
Source/Suin/Yaf/Twig fix getScriptPath() returns array
.gitignore add twig
README.md update readme
composer.json add twig

README.md

\Suin\Yaf\Twig

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

Something went wrong with that request. Please try again.