\Phug\Renderer\PartialSharedVariablesTrait

Trait SharedVariablesTrait: require OptionInterface to be implemented.

Summary

Methods
Properties
Constants
share()
resetSharedVariables()
No public properties found
No constants found
mergeWithSharedVariables()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

share()

share(array|string  $variables, mixed  $value = null) : $this

Share variables (local templates parameters) with all future templates rendered.

Parameters

array|string $variables

a variables name-value pairs or a single variable name

mixed $value

the variable value if the first argument given is a string

Returns

$this

Examples

'fr')
** File not found : $renderer->share('lang', **
=> 'My blog', 'today' => new DateTime()])
** File not found : $renderer->share(['title' **

resetSharedVariables()

resetSharedVariables() 

Remove all previously set shared variables.

mergeWithSharedVariables()

mergeWithSharedVariables(array  $parameters) : array

Returns merged globals, shared variables and locals.

Parameters

array $parameters

Returns

array