class ArrayLoader extends Loader

Loads a template from an array.

Properties

protected string $extension from  Loader
protected array $fallbackCache from  Loader
protected array $cache from  Loader
protected Model $source from  Loader
protected $templates

Methods

setSource(TemplateSource $source)

Sets a object to load the template from.

from  Loader
getSource()

No description

string
getMarkup(string $name)

Gets the markup section of a template, given its name.

string
getContents(string $name)

Gets the source code of a template, given its name.

getFilename($name)

No description

string
findTemplate(string $name)

Gets the path of a view file

from  Loader
string
getCacheKey(string $name)

Gets the cache key to use for the cache for a given template name.

bool
isFresh(string $name, int $time)

Returns true if the template is still fresh.

exists($name)

No description

getFilePath()

No description

__construct(array $templates = [])

No description

setTemplate(string $name, string $template)

Adds or overrides a template.

Details

in Loader at line 41
setSource(TemplateSource $source)

Sets a object to load the template from.

Parameters

TemplateSource $source

Specifies the Template object.

at line 11
TemplateSource getSource()

No description

Return Value

TemplateSource

at line 48
string getMarkup(string $name)

Gets the markup section of a template, given its name.

Parameters

string $name

The name of the template to load

Return Value

string

The template source code

Exceptions

Exception

at line 62
string getContents(string $name)

Gets the source code of a template, given its name.

Parameters

string $name

The name of the template to load

Return Value

string

The template source code

Exceptions

Exception

at line 34
getFilename($name)

No description

Parameters

$name

in Loader at line 82
protected string findTemplate(string $name)

Gets the path of a view file

Parameters

string $name

Return Value

string

at line 72
string getCacheKey(string $name)

Gets the cache key to use for the cache for a given template name.

Parameters

string $name

The name of the template to load

Return Value

string

The cache key

Exceptions

Exception

at line 81
bool isFresh(string $name, int $time)

Returns true if the template is still fresh.

Parameters

string $name

The template name

int $time

Timestamp of the last modification time of the cached template

Return Value

bool

true if the template is fresh, false otherwise

Exceptions

Exception

at line 67
exists($name)

No description

Parameters

$name

at line 90
getFilePath()

No description

at line 18
__construct(array $templates = [])

No description

Parameters

array $templates

An array of templates (keys are the names, and values are the source code)

at line 29
setTemplate(string $name, string $template)

Adds or overrides a template.

Parameters

string $name

The template name

string $template

The template source