Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

e1himself/axis-twig-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AxisTwigPlugin

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.

About

symfony 1.x plugin that integrates twig templating engine to be used with symfony

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages