public static function parseWidget($module, $action, $id = null)
{
// create new widget instance and return parsed content
$extra = FrontendBlockWidget::getForId(FrontendModel::get('kernel'), $module, $action, $id);
// set parseWidget because we will need it to skip setting headers in the display
FrontendModel::getContainer()->set('parseWidget', true);
try {
$extra->execute();
$content = $extra->getContent();
FrontendModel::getContainer()->set('parseWidget', null);
return $content;
} catch (Exception $e) {
// if we are debugging, we want to see the exception
if (FrontendModel::getContainer()->getParameter('kernel.debug')) {
throw $e;
}
return;
}
}