lithium\template\View::_step()
Performs a rendering step.
Parameters
-
array
$step
The array defining the step configuration to render.
-
array
$params
An associative array of string values used in the template lookup process. See the
$params
argument ofFile::template()
. -
array
$data
associative array for template data.
-
array
$options
An associative array of options to pass to the renderer. See the
$options
parameter ofRenderer::render()
orFile::render()
.
Returns
stringFilter
This method can be filtered.
Source
protected function _step(array $step, array $params, array &$data, array &$options = []) {
$step += ['path' => null, 'capture' => null];
$_renderer = $this->_renderer;
$_loader = $this->_loader;
$filters = $this->outputFilters;
$params = compact('step', 'params', 'options') + [
'data' => $data + $filters,
'loader' => $_loader,
'renderer' => $_renderer
];
$result = Filters::run($this, __FUNCTION__, $params, function($params) {
$template = $params['loader']->template($params['step']['path'], $params['params']);
return $params['renderer']->render($template, $params['data'], $params['options']);
});
if (is_array($step['capture'])) {
switch (key($step['capture'])) {
case 'context':
$options['context'][current($step['capture'])] = $result;
break;
case 'data':
$data[current($step['capture'])] = $result;
break;
}
}
return $result;
}