yiisoft/yii2 — pull request #4993 by creocoder (2014-09-12 07:36:07+00:00)
Title: `aliases.php` renamed to `bootstrap.php` (+ specific for apps)

Why its needed? For example you want to use DI feature for components. Its meaningless introduce new file and include it inside entry script. One `bootstrap.php` file for everything (setting up aliases, preconfigure components, etc). Examples:

**common\bootstrap.php**:

```php
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('booking', dirname(dirname(__DIR__)) . '/booking');
Yii::setAlias('common', dirname(__DIR__));
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
Yii::setAlias('representative', dirname(dirname(__DIR__)) . '/representative');
Yii::setAlias('shop', dirname(dirname(__DIR__)) . '/shop');
Yii::setAlias('uploads', dirname(dirname(__DIR__)) . '/uploads');

Yii::$container->set('yii\grid\ActionColumn', [
'buttons' => [
'view' => function ($url, $model) {
return Html::a('', $url, [
'title' => Yii::t('app', 'View'),
'class' => 'btn btn-xs blue',
'data-pjax' => '0',
]);
},
'update' => function ($url, $model) {
return Html::a('', $url, [
'title' => Yii::t('app', 'Update'),
'class' => 'btn btn-xs green',
'data-pjax' => '0',
]);
},
'delete' => function ($url, $model) {
return Html::a('', $url, [
'title' => Yii::t('app', 'Delete'),
'class' => 'btn btn-xs red',
'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
'data-method' => 'post',
'data-pjax' => '0',
]);
},
],
]);
```

**backend\bootstrap.php** (specific application bootstrap):

```php
Yii::$container->set('yii\grid\GridView', [
'pager' => false,
]);
```

So generally this idea is evolution of `aliases.php` file ideas.