Common\Mailer\Message::getTemplateContent PHP Метод

getTemplateContent() приватный Метод

Returns the content from a given template
private getTemplateContent ( string $template, array $variables = null ) : string
$template string The template to use.
$variables array The variables to assign.
Результат string
    private function getTemplateContent($template, $variables = null)
    {
        // with the strpos we check if it is a frontend template, in that case we use the frontend template to prevent
        // errors that the template could not be found. This way we don't have a backwards compatibility break.
        if (APPLICATION !== 'Backend' || strpos($template, FRONTEND_CORE_PATH) !== false) {
            return Model::get('templating')->render($template, $variables);
        }
        $tpl = new BackendTemplate(false);
        // variables were set
        if (!empty($variables)) {
            $tpl->assign($variables);
        }
        // grab the content
        return $tpl->getContent($template);
    }