Extends
lithium\core\Object
Renders the test output (e.g. layouts and filter templates).
Parameters
- string $template name of the template (i.e. `'layout'`).
- string|array $data array from `_data()` method.
Returns
stringSource
public function render($template, $data = array()) {
$config = $this->_config;
if ($template == "stats" && !$data) {
$data = $this->stats();
}
$template = Libraries::locate('test.templates', $template, array(
'filter' => false, 'type' => 'file', 'suffix' => ".{$config['format']}.php"
));
$params = compact('template', 'data', 'config');
return $this->_filter(__METHOD__, $params, function($self, $params, $chain) {
extract($params['data']);
ob_start();
include $params['template'];
return ob_get_clean();
});
}