Вход Регистрация
Файл: system/src/System/View/RenderEngineFactory.php
Строк: 86
<?php

/**
 * This file is part of JohnCMS Content Management System.
 *
 * @copyright JohnCMS Community
 * @license   https://opensource.org/licenses/GPL-3.0 GPL-3.0
 * @link      https://johncms.com JohnCMS Project
 */

declare(strict_types=1);

namespace 
JohncmsSystemView;

use 
JohncmsSystemUsersUser;
use 
JohncmsSystemViewExtensionAssets;
use 
JohncmsSystemViewExtensionAvatar;
use 
PsrContainerContainerInterface;
use 
JohncmsSystemi18nTranslator;

class 
RenderEngineFactory
{
    public function 
__invoke(ContainerInterface $container): Render
    
{
        
$config $container->get('config')['johncms'];
        
$engine = new Render('phtml');
        
$engine->setTheme($config['skindef']);
        
$engine->addFolder('system'realpath(THEMES_PATH 'default/templates/system'));
        
$engine->loadExtension($container->get(Assets::class));
        
$engine->loadExtension($container->get(Avatar::class));
        
$engine->addData(
            [
                
'container' => $container,
                
'config'    => $config,
                
'locale'    => $container->get(Translator::class)->getLocale(),
                
'user'      => $container->get(User::class),
            ]
        );

        return 
$engine;
    }
}
Онлайн: 0
Реклама