D
D
DANIIILKA2016-10-27 14:00:17
Yii
DANIIILKA, 2016-10-27 14:00:17

Where do objects (properties of the $app object) come from in the static property (Yii::$app), who put them there, how is this machine arranged, in Yii2?

How and where is the $app object formed in Yii2, thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-10-27
@webinar

In the core and application config. For example, let's add our component:

'components' => [
        'settings'=>[
            'class' => 'backend\modules\main\components\Settings',
        ],
...
],

Now we can access its methods via:
Yii::$app->settings

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question