Frontend\Core\Engine\TemplateModifiers::parseWidget PHP Метод

parseWidget() публичный статический Метод

syntax: {{ parsewidget($module, $action, $id) }}
public static parseWidget ( string $module, string $action, string $id = null ) : null | string
$module string The module whose module we want to execute.
$action string The action to execute.
$id string The widget id (saved in data-column).
Результат null | string
    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;
        }
    }