PHP Class Symfony\Bundle\TwigBundle\Loader\FilesystemLoader

Author: Fabien Potencier ([email protected])
Inheritance: extends Twig_Loader_Filesystem
Mostra file Open project: symfony/symfony Class Usage Examples

Protected Properties

Property Type Description
$locator
$parser

Public Methods

Method Description
__construct ( Symfony\Component\Config\FileLocatorInterface $locator, Symfony\Component\Templating\TemplateNameParserInterface $parser, string | null $rootPath = null ) Constructor.
exists ( $name )

Protected Methods

Method Description
findTemplate ( string | Symfony\Component\Templating\TemplateReferenceInterface $template, boolean $throw = true ) : string Returns the path to the template file.

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\Config\FileLocatorInterface $locator, Symfony\Component\Templating\TemplateNameParserInterface $parser, string | null $rootPath = null )
$locator Symfony\Component\Config\FileLocatorInterface A FileLocatorInterface instance
$parser Symfony\Component\Templating\TemplateNameParserInterface A TemplateNameParserInterface instance
$rootPath string | null The root path common to all relative paths (null for getcwd())

exists() public method

The name parameter might also be a TemplateReferenceInterface.
public exists ( $name )

findTemplate() protected method

The file locator is used to locate the template when the naming convention is the symfony one (i.e. the name can be parsed). Otherwise the template is located using the locator from the twig library.
protected findTemplate ( string | Symfony\Component\Templating\TemplateReferenceInterface $template, boolean $throw = true ) : string
$template string | Symfony\Component\Templating\TemplateReferenceInterface The template
$throw boolean When true, a \Twig_Error_Loader exception will be thrown if a template could not be found
return string The path to the template file

Property Details

$locator protected_oe property

protected $locator

$parser protected_oe property

protected $parser