-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBootstrap.php
34 lines (29 loc) · 958 Bytes
/
Bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace altiore\recipe;
use Yii;
use yii\base\BootstrapInterface;
/**
* Hook with application bootstrap stage
* @author John Martin <[email protected]>
* @since 1.0.0
*/
class Bootstrap implements BootstrapInterface
{
/**
* Initial application compoments and modules need for extension
* @param \yii\base\Application $app The application currently running
* @return void
*/
public function bootstrap($app) {
// Set alias for extension source
Yii::setAlias("@recipe", __DIR__);
Yii::setAlias('@recipe_resources', __DIR__ . '/react/dist/static');
// Setup i18n compoment for translate all category user*
if (!isset(Yii::$app->get('i18n')->translations['recipe*'])) {
Yii::$app->get('i18n')->translations['recipe*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => __DIR__ . '/messages',
];
}
}
}