/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*
* @throws \Exception
*/
public function display($tpl = null)
{
// Prepare view data
$this->initializeView();
// Check for errors.
if (\count($errors = $this->get('Errors'))) {
throw new GenericDataException(implode("\n", $errors), 500);
}
// Build toolbar
$this->addToolbar();
parent::display($tpl);
}