PHP Класс lithium\template\view\adapter\File

For more information about implementing your own template loaders or renderers, see the lithium\template\View class.
См. также: lithium\template\View
См. также: lithium\template\view\Compiler
Наследование: extends lithium\template\view\Renderer
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_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.

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

Метод Описание
__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

Защищенные методы

Метод Описание
_paths ( string $type, array $params ) : string Searches one or more path templates for a matching template file, and returns the file name.

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

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

Constructor.
public __construct ( array $config = [] ) : void
$config array Configuration options.
Результат void

_paths() защищенный Метод

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.
Результат string Returns the first template file found. Throws an exception if no templates are available.

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

Part of ArrayAccess. isset($file['bar']); $file->offsetExists('bar');
public offsetExists ( string $offset ) : boolean
$offset string Key / variable name to check.
Результат boolean Returns `true` if the value is set, otherwise `false`.

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

Part of ArrayAccess. $file['bar']; $file->offsetGet('bar');
public offsetGet ( string $offset ) : mixed
$offset string Key / variable name to check.
Результат mixed

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

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`.
Результат void

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

Part of ArrayAccess. unset($file['bar']); $file->offsetUnset('bar');
public offsetUnset ( string $offset ) : void
$offset string Key / variable name to check.
Результат void

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

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
Результат string

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

Returns a template file name
public template ( string $type, array $params ) : string
$type string
$params array
Результат string

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

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

These configuration variables will automatically be assigned to their corresponding protected properties when the object is initialized.
protected array $_autoConfig
Результат array

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

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.
См. также: Renderer::$_handlers
protected array $_classes
Результат array

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

Boolean flag indicating whether templates should be pre-compiled before inclusion. For more information on template compilation, see view\Compiler.
См. также: lithium\template\view\Compiler
protected bool $_compile
Результат boolean

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

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
Результат array

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

protected $_paths

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

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