public function getLayout($layout = null, array $data = array())
{
// Adjust the current used Layout.
$layout = $layout ?: $this->layout;
if ($layout instanceof View) {
return $layout->with($data);
} else {
if (is_string($layout)) {
return Template::make($layout, $data, $this->template);
}
}
throw new BadMethodCallException('Method not available for the current Layout');
}