FileAccess Orion

TemplateInclude
in package

Implement template include object

This class provides general interfaces to handle template includes.

Tags
category

Helper

author

Tobias Teichner webmaster@teichner.biz

since

File available since v0.180

Table of Contents

$row  : string
The parsed include row
$src  : string|null
The file content target path
$storage  : string|null
The file content target path
$template_root  : string
Path to template root folder
$type  : string
The data type
__construct()  : mixed
Template include constructor.
Age()  : bool|int
Age of file
Content()  : bool|null|string
Get content Reads the whole content of the file as string
IsDirect()  : bool
Has redirect Check if attribute for redirect set
IsDynamicStylesheet()  : bool
Is dynamic css type
IsExternal()  : bool
Is external Check if the source path uses ann external fetch protocol
IsJavascript()  : bool
Is javascript Check if include is a script include tag
IsStylesheet()  : bool
Is css Check if include is a script include tag
Relation()  : null|string
Get the relation content Extracts the value from the rel attribute of the processed tag
Source()  : null|string
Get the source path
StoragePath()  : string|null
Get storage path

Properties

$storage

The file content target path

private string|null $storage = null

$template_root

Path to template root folder

private string $template_root

Methods

__construct()

Template include constructor.

public __construct(string $row, string $type[, string $template_root = '' ]) : mixed
Parameters
$row : string

A include line

$type : string

The template type

$template_root : string = ''

The template root path, absolute

Return values
mixed

Age()

Age of file

public Age() : bool|int

Return the age of the file based on last modification. May return -1 when its no local file

Return values
bool|int

Content()

Get content Reads the whole content of the file as string

public Content() : bool|null|string
Return values
bool|null|string

IsDirect()

Has redirect Check if attribute for redirect set

public IsDirect() : bool
Return values
bool

True when attribute is set

IsDynamicStylesheet()

Is dynamic css type

public IsDynamicStylesheet() : bool

Depending on the extension this will be handled as dynamic include

Return values
bool

IsExternal()

Is external Check if the source path uses ann external fetch protocol

public IsExternal() : bool
Return values
bool

IsJavascript()

Is javascript Check if include is a script include tag

public IsJavascript() : bool
Return values
bool

True when attribute is set

IsStylesheet()

Is css Check if include is a script include tag

public IsStylesheet() : bool
Return values
bool

True when attribute is set

Relation()

Get the relation content Extracts the value from the rel attribute of the processed tag

public Relation() : null|string
Return values
null|string

Source()

Get the source path

public Source([bool $remove_ext = true ]) : null|string

Calculates the absolute storage root path. Will automatically use the root path and fallback to known root paths

Parameters
$remove_ext : bool = true
Return values
null|string

StoragePath()

Get storage path

public StoragePath() : string|null
Return values
string|null

Search results