TwigExtensions
in package

This is the TwigExtensions base class.

A TwigExtensions class is in charge to encapsulate usefull Extensions for Twig and provide a method to add them to the Twig Environment you want.

Tags
abstract
see
TwigExtensions::addLocalExtensions()
see
TwigExtensions::isAdded()
see
TwigExtensions::addExtensions()

Table of Contents

addExtensions() This method adds, if they were not added before, the Twig Extensions defined by this TwigExtensions class to the Twig environment passed by parameter.  : void
isAdded() This method returns true if the Twig Extensions defined in this TwigExtensions class has been already added to the Twig Environment passed by parameter, it returns False otherwise.  : bool
addLocalExtensions() This method adds the Twig Extensions defined by this TwigExtensions class to the Twig Environment passed by parameter.  : void

Methods

addExtensions()

This method adds, if they were not added before, the Twig Extensions defined by this TwigExtensions class to the Twig environment passed by parameter.

public static addExtensions(Environment $twig) : void
Parameters
$twig : Environment
Return values
void

isAdded()

This method returns true if the Twig Extensions defined in this TwigExtensions class has been already added to the Twig Environment passed by parameter, it returns False otherwise.

public static isAdded(Environment $twig) : bool
Parameters
$twig : Environment
Return values
bool

addLocalExtensions()

This method adds the Twig Extensions defined by this TwigExtensions class to the Twig Environment passed by parameter.

protected abstract static addLocalExtensions(Environment $twig) : void
Parameters
$twig : Environment
Return values
void

Search results