Extends
lithium\core\Object
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 of `File::template()`.
- array $data associative array for template data.
- array $options An associative array of options to pass to the renderer. See the `$options` parameter of `Renderer::render()` or `File::render()`.
Returns
stringSource
protected function _step(array $step, array $params, array &$data, array &$options = array()) {
$step += array('path' => null, 'capture' => null);
$_renderer = $this->_renderer;
$_loader = $this->_loader;
$filters = $this->outputFilters;
$params = compact('step', 'params', 'options') + array('data' => $data + $filters);
$filter = function($self, $params) use (&$_renderer, &$_loader) {
$template = $_loader->template($params['step']['path'], $params['params']);
return $_renderer->render($template, $params['data'], $params['options']);
};
$result = $this->_filter(__METHOD__, $params, $filter);
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;
}