PHP Class Box\Brainy\Templates\TemplateBase

Inheritance: extends Box\Brainy\Templates\TemplateData
Afficher le fichier Open project: box/brainy Class Usage Examples

Méthodes publiques

Свойство Type Description
$smarty Smarty Global smarty instance
$strict_mode boolean Flag indicating that the template is running in strict mode
$template_resource string Template resource

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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 méthode

public assertIsNotStrict ( string $reason ) : void
$reason string
Résultat void

display() public méthode

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
Résultat void

fetch() public méthode

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
Résultat string rendered template output

renderSubTemplate() public méthode

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
Résultat void

setVariable() public méthode

Assigns $value to the variale $var.
See also: 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
Résultat void

Property Details

$smarty public_oe property

Global smarty instance
public Smarty $smarty
Résultat Smarty

$strict_mode public_oe property

Flag indicating that the template is running in strict mode
public bool $strict_mode
Résultat boolean

$template_resource public_oe property

Template resource
public string $template_resource
Résultat string