From twig-project.org
Fast: Twig compiles templates down to plain optimized PHP code. The overhead compared to regular PHP code was reduced to the very minimum.
Secure: Twig has a sandbox mode to evaluate untrusted template code. This allows Twig to be used as a templating language for applications where users may modify the template design.
Flexible: Twig is powered by a flexible lexer and parser. This allows the developer to define its own custom tags and filters, and create its own DSL.
Credit goes to Jonathan Geiger, John Heathco and Mathew Davies for creating the original modules. This fork contains the following improvements:
- X-Version: This Twig module works across all 3.x strains of Kohana (3.0.x, 3.1.x, 3.2.x)
- Updated Twig, currently running 1.1.2
I (Alex) will try and keep this module up to date with Twig and Kohana. If you find a bug let me know!
git submodule add https://[email protected]/ThePixelDeveloper/kohana-twig.git modules/twig
cd modules/twig && git submodule update --init
- Enable twig in your bootstrap.php file
- Extend
Controller_Template_Twig
Pretty similar to using the Controller_Template class.
class Controller_Example extends Controller_Template_Twig
{
// Template names are generated automatically if not specified. So this
// action would map to: example/index.html
public function action_index()
{
$this->template->variable = "Hello World";
}
}
Either file a bug report or try an alternative project: