You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace backend\bootstrap;
|
|
|
|
|
|
|
|
use core\entities\Settings;
|
|
|
|
use mihaildev\ckeditor\CKEditor;
|
|
|
|
use mihaildev\elfinder\ElFinder;
|
|
|
|
use yii\base\BootstrapInterface;
|
|
|
|
use yii\helpers\ArrayHelper;
|
|
|
|
|
|
|
|
class SetUp implements BootstrapInterface
|
|
|
|
{
|
|
|
|
public function bootstrap($app)
|
|
|
|
{
|
|
|
|
$container = \Yii::$container;
|
|
|
|
$container->set(CKEditor::class, [
|
|
|
|
'editorOptions' => ElFinder::ckeditorOptions('elfinder', []),
|
|
|
|
]);
|
|
|
|
|
|
|
|
// load settings
|
|
|
|
$settings = ArrayHelper::map(Settings::find()->andWhere(['active' => 1])->all(), 'key', 'value', 'section');
|
|
|
|
$app->params['settings'] = $settings;
|
|
|
|
|
|
|
|
// Connect backend modules
|
|
|
|
|
|
|
|
// Add finish UrlRules
|
|
|
|
$app->getUrlManager()->addRules([
|
|
|
|
'<_c:[\w\-]+>' => '<_c>/index',
|
|
|
|
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
|
|
|
|
'<_c:[\w\-]+>/<_a:[\w-]+>' => '<_c>/<_a>',
|
|
|
|
'<_c:[\w\-]+>/<id:\d+>/<_a:[\w\-]+>' => '<_c>/<_a>',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|