Yii2: differences between init() and bootstrap() and best place to add dynamical URLs on a module
问题 I dont understand exactly what is the difference between use init() and bootstrap() on a class. My case: I want to add dynamical urls from my module by using Yii::$app->urlManager->addRules(...) but NOT loading the module in order to improve the performance. So, I thought if bootstraping the module from the main configuration file like: 'bootstrap' => ['mymodule'] , the Module::bootstrap() function will be executed ONLY and exclusively. But actually always runs Module::init() function, and