PHP Class Symfony\Bundle\TwigBundle\Loader\FilesystemLoader

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

Protected Properties

Свойство Type Description
$locator
$parser

Méthodes publiques

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

Méthodes protégées

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

Method Details

__construct() public méthode

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 méthode

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

findTemplate() protected méthode

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
Résultat string The path to the template file

Property Details

$locator protected_oe property

protected $locator

$parser protected_oe property

protected $parser