lithium\test\Report::render()

public method

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

string

Filter

This method can be filtered.

Source

	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();
		});
	}