Код: Выделить всё
<?php
...
/**
* Site module bootstrap class.
*/
class Bootstrap implements \yii\base\BootstrapInterface
{
/**
* @inheritdoc
*/
public function bootstrap($app)
{
}
}
...
Скажем чем Bootstrap будет отличатся от:
Код: Выделить всё
...
/**
* Site module
*/
class Module extends \yii\base\Module
{
/**
* @inheritdoc
*/
public function init()
{
parent::init();
Yii::$app->getUrlManager()->addRules(
[
'' => 'site/default/index',
]
);
// Add module I18N category.
if (!isset($app->i18n->translations['site.*'])) {
Yii::$app->i18n->translations['site*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@frontend/modules/site/messages',
'forceTranslation' => true,
'fileMap' => [
'site.main' => 'main.php',
]
];
}
}
...