The list of available rendering steps. Each step contains instructions for how to render one
piece of a multi-step view rendering. The
View class combines multiple steps into
processes to create the final output.
Each step is named by its key in the
$_steps array, and can have the following options:
'path'string: Indicates the set of paths to use when loading templates.
'conditions'mixed: Make the step dependent on a value being present, or on some other arbitrary condition. If a
'conditions'is a string, it indicates that a key with that name must be present in the
render(), and must be set to a non-empty value. If a closure, it will be executed with the rendering parameters, and must return
false. In either case, if the condition is satisfied, the step is processed. Otherwise, it is skipped. See the
_conditions()method for more information.
'capture'array: If specified, allows the results of this rendering step to be assigned to a template variable used in subsequent steps, or to the templating context for use in subsequent steps. If can be specified in the form of
array('context' => '<var-name>')or
array('data' => '<var-name>'). If the
'context'key is used, the results are captured to the rendering context. Likewise with the
'data'key, results are captured to a template variable.
'multi'boolean: If set to
true, the rendering parameter matching the name of this step can be an array containing multiple values, in which case this step is executed multiple times, once for each value of the array.
protected $_steps = [ 'template' => ['path' => 'template', 'capture' => ['context' => 'content']], 'layout' => [ 'path' => 'layout', 'conditions' => 'layout', 'multi' => true, 'capture' => [ 'context' => 'content' ] ], 'element' => ['path' => 'element'] ];