Answer the question
In order to leave comments, you need to log in
How to run the model before the controller runs?
It is necessary to define an invite to the site.
There is a model that parses the url (special parameter). It must be run BEFORE any controller. For each controller is not an option to call.
Am I doing everything right?
Answer the question
In order to leave comments, you need to log in
Or write a component by implementing the yii\base\BootstrapInterface interface , write it in the config in the components and bootstrap section and you will be happy.
разбором и формированием url должен заниматься url-менеджер, если в проекте есть какие-то особенности url тогда стоит переопределять этот компонент
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question