PHP Класс Goetas\Twital\TwitalLoader

Compiles a Twital template into a Twig template.
Автор: Asmir Mustafic ([email protected])
Наследование: implements Twig_LoaderInterface, implements Twig_ExistsLoaderInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$loader Twig_LoaderInterface The wrapped Twig loader
$sourceAdapters array Items are strings or callbacks
$twital Twital The internal Twital compiler

Открытые методы

Метод Описание
__construct ( Twig_LoaderInterface $loader = null, Twital $twital = null, boolean $addDefaults = true ) Creates a new Twital loader.
addSourceAdapter ( string | callback $pattern, Goetas\Twital\SourceAdapter $adapter ) : TwitalLoader Add a new pattern that can decide if a template is twital-compilable or not.
exists ( $name )
getCacheKey ( $name )
getLoader ( ) : Twig_LoaderInterface Get the wrapped Twig loader
getSource ( $name )
getSourceAdapter ( string $name ) : Goetas\Twital\SourceAdapter Decide if a template is twital-compilable or not.
getSourceAdapters ( ) : array: Get all patterns used to choose if a template is twital-compilable or not
getTwital ( ) : Twital
isFresh ( $name, $time )
setLoader ( Twig_LoaderInterface $loader ) : TwitalLoader Set the wrapped Twig loader

Описание методов

__construct() публичный Метод

Creates a new Twital loader.
public __construct ( Twig_LoaderInterface $loader = null, Twital $twital = null, boolean $addDefaults = true )
$loader Twig_LoaderInterface
$twital Twital
$addDefaults boolean If NULL, some standard rules will be used (`*.twital.*` and `*.twital`).

addSourceAdapter() публичный Метод

If $pattern is a string, then must be a valid regex that matches the template filename. If $pattern is a callback, then must return true if the template is compilable, false otherwise.
public addSourceAdapter ( string | callback $pattern, Goetas\Twital\SourceAdapter $adapter ) : TwitalLoader
$pattern string | callback
$adapter Goetas\Twital\SourceAdapter
Результат TwitalLoader

exists() публичный Метод

public exists ( $name )

getCacheKey() публичный Метод

public getCacheKey ( $name )

getLoader() публичный Метод

Get the wrapped Twig loader
public getLoader ( ) : Twig_LoaderInterface
Результат Twig_LoaderInterface

getSource() публичный Метод

public getSource ( $name )

getSourceAdapter() публичный Метод

Decide if a template is twital-compilable or not.
public getSourceAdapter ( string $name ) : Goetas\Twital\SourceAdapter
$name string
Результат Goetas\Twital\SourceAdapter

getSourceAdapters() публичный Метод

Get all patterns used to choose if a template is twital-compilable or not
public getSourceAdapters ( ) : array:
Результат array:

getTwital() публичный Метод

public getTwital ( ) : Twital
Результат Twital

isFresh() публичный Метод

public isFresh ( $name, $time )

setLoader() публичный Метод

Set the wrapped Twig loader
public setLoader ( Twig_LoaderInterface $loader ) : TwitalLoader
$loader Twig_LoaderInterface
Результат TwitalLoader

Описание свойств

$loader защищенное свойство

The wrapped Twig loader
protected Twig_LoaderInterface $loader
Результат Twig_LoaderInterface

$sourceAdapters защищенное свойство

Items are strings or callbacks
protected array $sourceAdapters
Результат array

$twital защищенное свойство

The internal Twital compiler
protected Twital,Goetas\Twital $twital
Результат Twital