waldson/twig-module-for-kohana

为 Kohana 3.3 开发的 TWIG 模块,可无缝使用 twig 模板作为 Kohana 视图

维护者

详细信息

github.com/waldson/twig

源代码

问题

安装次数: 34

依赖关系: 0

建议者: 0

安全: 0

星标: 2

关注者: 2

分支: 2

开放问题: 0

类型:kohana-module

0.1 2013-02-10 23:38 UTC

This package is not auto-updated.

Last update: 2024-09-28 13:12:00 UTC


README

为 Kohana 3.3 开发的 TWIG 模块,可无缝使用模板作为 Kohana 视图。

使用方法

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

还有一个模板控制器

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'));
	}

}