PHP Класс Box\Brainy\Templates\TemplateBase

Наследование: extends Box\Brainy\Templates\TemplateData
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$smarty Smarty Global smarty instance
$strict_mode boolean Flag indicating that the template is running in strict mode
$template_resource string Template resource

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

Метод Описание
__construct ( Box\Brainy\Brainy $brainyInstance, boolean | void $useRootScope = false )
assertIsNotStrict ( string $reason ) : void
display ( string | null | void $template = null, string | null | void $compile_id = null ) : void Renders the template.
fetch ( string | void $template = null, mixed | void $compile_id = null ) : string Renders and returns a template.
renderSubTemplate ( string $template, mixed $compile_id, $data, integer $parent_scope ) : void Template code runtime function to get subtemplate content
setVariable ( string $var, mixed $value, integer $scope ) : void Assigns $value to the variale $var.

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

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

public __construct ( Box\Brainy\Brainy $brainyInstance, boolean | void $useRootScope = false )
$brainyInstance Box\Brainy\Brainy
$useRootScope boolean | void Whether to clone data from the root scope

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

public assertIsNotStrict ( string $reason ) : void
$reason string
Результат void

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

This displays the contents of a template. To return the contents of a template into a variable, use the fetch() method instead. As an optional second and third parameter, you can pass a cache ID and compile ID. A fourth parameter can be passed which passes the parent scope that the template should use.
public display ( string | null | void $template = null, string | null | void $compile_id = null ) : void
$template string | null | void the resource handle of the template file or template object
$compile_id string | null | void compile id to be used with this template
Результат void

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

This returns the template output instead of displaying it.
public fetch ( string | void $template = null, mixed | void $compile_id = null ) : string
$template string | void the resource handle of the template file or template object
$compile_id mixed | void compile id to be used with this template
Результат string rendered template output

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

Template code runtime function to get subtemplate content
public renderSubTemplate ( string $template, mixed $compile_id, $data, integer $parent_scope ) : void
$template string the resource handle of the template file
$compile_id mixed compile id to be used with this template
$parent_scope integer scope in which {include} should execute
Результат void

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

Assigns $value to the variale $var.
См. также: TemplateData::assignSingleVar()
public setVariable ( string $var, mixed $value, integer $scope ) : void
$var string the template variable name
$value mixed the value to assign
$scope integer the scope to associate with the Smarty_Variable
Результат void

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

$smarty публичное свойство

Global smarty instance
public Smarty $smarty
Результат Smarty

$strict_mode публичное свойство

Flag indicating that the template is running in strict mode
public bool $strict_mode
Результат boolean

$template_resource публичное свойство

Template resource
public string $template_resource
Результат string