Properties

$_tag_stack

$_tag_stack : array

tag stack

Type

array

$default_modifier_list

$default_modifier_list : mixed

saved preprocessed modifier list

Type

mixed

$suppressHeader

$suppressHeader : boolean

suppress Smarty header code in compiled template

Type

boolean

$has_code

$has_code : boolean

Type

boolean

$idInc

$idInc : integer

Type

integer

Methods

__construct()

__construct(\Box\Brainy\Brainy  $smarty) 

Parameters

\Box\Brainy\Brainy $smarty

global instance

getUniqueVarName()

getUniqueVarName() : string

Returns a unique variable name, sans dollar sign.

Returns

string —

Unique variable name

compileTemplate()

compileTemplate(\Box\Brainy\Templates\Template  $template) : boolean

Method to compile a Smarty template

Parameters

\Box\Brainy\Templates\Template $template

template object to compile

Returns

boolean —

true if compiling succeeded, false if it failed

compileTag()

compileTag(string  $tag, array  $args, array  $parameter = array()) : string

Parameters

string $tag

tag name

array $args

array with tag attributes

array $parameter

array with compilation parameter

Returns

string —

compiled code

trigger_template_error()

trigger_template_error(string  $args = null, string  $line = null, string|void  $exception_class = '\Box\Brainy\Exceptions\SmartyCompilerException') 

display compiler error messages without dying

If parameter $args is empty it is a parser detected syntax error. In this case the parser is called to obtain information about expected tokens.

If parameter $args contains a string this is used as error message

Parameters

string $args

individual error message or null

string $line

line-number

string|void $exception_class

The name of the exception class to raise

Throws

\Box\Brainy\Exceptions\SmartyCompilerException

when an unexpected token is found

trigger_expression_modifiers_error()

trigger_expression_modifiers_error() : void

Show an error related to Brainy::$enforce_expression_modifiers

Throws

\Box\Brainy\Exceptions\SmartyCompilerException

assert_no_enforced_modifiers()

assert_no_enforced_modifiers(boolean|void  $static = false) : void

Show an error related to Brainy::$enforce_expression_modifiers

Parameters

boolean|void $static

When true, the expression is static.

assert_is_not_strict()

assert_is_not_strict(string  $reason, \Box\Brainy\Templates\Template|null|void  $template = null) : void

Parameters

string $reason
\Box\Brainy\Templates\Template|null|void $template

Throws

\Box\Brainy\Compiler\BrainyStrictModeException

assertIsInTag()

assertIsInTag(string  $name) : mixed

Asserts that a tag is open

Parameters

string $name

Name of the tag

Returns

mixed —

Data associated with the tag

doCompile()

doCompile(mixed  $_content) : boolean

method to compile a Smarty template

Parameters

mixed $_content

template source

Returns

boolean —

true if compiling succeeded, false if it failed

formatStaticArgs()

formatStaticArgs(array  $args, boolean|void  $export = true) : string

Formats args for old compiler plugins

Parameters

array $args
boolean|void $export

Whether to use var_export or to manually construct an array

Returns

string

formatPluginArgs()

formatPluginArgs(array  $args) : array

Formats args for old compiler plugins

Parameters

array $args

Returns

array