public function render($data = array(), $helperFunctions = array())
{
$template = static::BASE_PATH . $this->name . '.phtml';
try {
$this->set($data);
$this->helperFunctions = array_merge($this->helperFunctions, $helperFunctions);
extract($this->data);
ob_start();
if (file_exists($template)) {
include $template;
} else {
throw new \LogicException('The template "' . $template . '" not found.');
}
$content = ob_get_clean();
return $content;
} catch (\LogicException $e) {
ob_end_clean();
throw new \LogicException($e->getMessage());
}
}