Renders a URI and returns the Response content.
Available options:
string|ControllerReference $uri A URI as a string or a ControllerReference instance:
string $renderer The renderer name:
array $options An array of options:
string|null The Response content or null when the Response is streamed
\InvalidArgumentException when the renderer does not exist
\RuntimeException when the Response is not successful
public function render($uri, $renderer = 'inline', array $options = array()) {
if (!isset($options['ignore_errors'])) {
$options['ignore_errors'] = !$this->debug;
}
if (!isset($this->renderers[$renderer])) {
throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer));
}
if (null === $this->request) {
throw new \LogicException('Rendering a fragment can only be done when handling a master Request.');
}
return $this
->deliver($this->renderers[$renderer]
->render($uri, $this->request, $options));
}