waldson/twig-module-for-kohana

TWIG module for Kohana 3.3 to use twig templates as Kohana views seamlessly

Installs: 19

Dependents: 0

Stars: 2

Watchers: 1

Forks: 2

Language: PHP

0.1 2013-02-10 23:38 UTC

README

TWIG Module for Kohana 3.3 to use templates as Kohana views seamlessly.

Usage

// inside an action in your controller...
$this->response->body(Twig_View::factory('path/to/your/twig/view');

there is also a template controller:

class Controller_Welcome extends Twig_Controller_Template {

    //default $template is twig/template
    public $template = 'path/to/your/template';

    function action_index()
    {
        $this->var = 'value';
        $this->foo = View::factory('your_normal_kohana_view');
        $this->bar = Twig_View::factory('your_twig_view', array('view_var' => 'view_value'));
    }

}