PHP Class lithium\template\view\adapter\File

For more information about implementing your own template loaders or renderers, see the lithium\template\View class.
See also: lithium\template\View
See also: lithium\template\view\Compiler
Inheritance: extends lithium\template\view\Renderer
Afficher le fichier Open project: unionofrad/lithium Class Usage Examples

Protected Properties

Свойство Type Description
$_autoConfig array These configuration variables will automatically be assigned to their corresponding protected properties when the object is initialized.
$_classes array File's dependencies. These classes are used by the output handlers to generate URLs for dynamic resources and static assets, as well as compiling the templates.
$_compile boolean Boolean flag indicating whether templates should be pre-compiled before inclusion. For more information on template compilation, see view\Compiler.
$_data array An array containing the variables currently in the scope of the template. These values are manipulable using array syntax against the template object, i.e. $this['foo'] = 'bar' inside your template files.
$_paths
$_vars Variables that have been set from a view/element/layout/etc. that should be available to the same rendering context.

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) : void Constructor.
offsetExists ( string $offset ) : boolean Allows checking to see if a value is set in template data.
offsetGet ( string $offset ) : mixed Gets the offset, or null in the template data.
offsetSet ( string $offset, mixed $value ) : void Sets the offset with the given value.
offsetUnset ( string $offset ) : void Unsets the given offset.
render ( string $template, array | string $data = [], array $options = [] ) : string Renders content from a template file provided by template().
template ( string $type, array $params ) : string Returns a template file name

Méthodes protégées

Méthode Description
_paths ( string $type, array $params ) : string Searches one or more path templates for a matching template file, and returns the file name.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $config = [] ) : void
$config array Configuration options.
Résultat void

_paths() protected méthode

Searches one or more path templates for a matching template file, and returns the file name.
protected _paths ( string $type, array $params ) : string
$type string
$params array The set of options keys to be interpolated into the path templates when searching for the correct file to load.
Résultat string Returns the first template file found. Throws an exception if no templates are available.

offsetExists() public méthode

Part of ArrayAccess. isset($file['bar']); $file->offsetExists('bar');
public offsetExists ( string $offset ) : boolean
$offset string Key / variable name to check.
Résultat boolean Returns `true` if the value is set, otherwise `false`.

offsetGet() public méthode

Part of ArrayAccess. $file['bar']; $file->offsetGet('bar');
public offsetGet ( string $offset ) : mixed
$offset string Key / variable name to check.
Résultat mixed

offsetSet() public méthode

Part of ArrayAccess. $file['bar'] = 'baz'; $file->offsetSet('bar', 'baz');
public offsetSet ( string $offset, mixed $value ) : void
$offset string Key / variable name to check.
$value mixed Value you wish to set to `$offset`.
Résultat void

offsetUnset() public méthode

Part of ArrayAccess. unset($file['bar']); $file->offsetUnset('bar');
public offsetUnset ( string $offset ) : void
$offset string Key / variable name to check.
Résultat void

render() public méthode

Renders content from a template file provided by template().
public render ( string $template, array | string $data = [], array $options = [] ) : string
$template string
$data array | string
$options array
Résultat string

template() public méthode

Returns a template file name
public template ( string $type, array $params ) : string
$type string
$params array
Résultat string

Property Details

$_autoConfig protected_oe property

These configuration variables will automatically be assigned to their corresponding protected properties when the object is initialized.
protected array $_autoConfig
Résultat array

$_classes protected_oe property

File's dependencies. These classes are used by the output handlers to generate URLs for dynamic resources and static assets, as well as compiling the templates.
See also: Renderer::$_handlers
protected array $_classes
Résultat array

$_compile protected_oe property

Boolean flag indicating whether templates should be pre-compiled before inclusion. For more information on template compilation, see view\Compiler.
See also: lithium\template\view\Compiler
protected bool $_compile
Résultat boolean

$_data protected_oe property

An array containing the variables currently in the scope of the template. These values are manipulable using array syntax against the template object, i.e. $this['foo'] = 'bar' inside your template files.
protected array $_data
Résultat array

$_paths protected_oe property

protected $_paths

$_vars protected_oe property

Variables that have been set from a view/element/layout/etc. that should be available to the same rendering context.
protected $_vars