axis / axis-twig-plugin
symfony 1.x plugin that integrates twig templating engine to be used with symfony.
Installs: 147
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:symfony1-plugin
Requires
- php: >=5.3.0
- axis/axis-service-container-plugin: dev-master
- composer/installers: *
- symfony/class-loader: 2.2.x-dev
- twig/twig: 1.*
This package is not auto-updated.
Last update: 2020-06-12 17:23:29 UTC
README
This plugin integrates Twig templating engine into symfony.
Installation
Composer way
Just add axis/axis-twig-plugin
dependency to your composer.json
file:
"require": { "axis/axis-twig-plugin": "dev-master" }
Configuration
You can configure Twig environment using factories.yml
(see AxisServiceContainerPlugin).
Usage
You can use Twig directly by retrieving Twig Environment from context service container:
$twig = sfContext::getInstance()->get('twig'); $twig->loadTemplate($pathToTemplate)->render($variables);
or as symfony view by setting it as view class in module.yml
:
all: view_class: \Axis\S1\Twig\View\Base # means BaseView partial_view_class: \Axis\S1\Twig\View\Base # means BasePartialView
after that your application will switch to .twig templates for layouts, partials and action views.