Answer the question
In order to leave comments, you need to log in
Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: yii\console\Application::getSession()'. What to do?
It just so happened that I need to give a command on the web application to launch the action of the console controller to simulate background processing of a request from an outside service and then fill in the table column in the database with the received data (through the model). I call an action in the web controller, which calls the console controller, namely the action, which should form a queue and then run it. However, when I run this action, an exception is thrown with the text 'Calling unknown method: yii\console\Application::getSession()'.
I want to say right away that in the console config there is the following code:
'components' => [
//...another code
'session' => [ // for use session in console application
'class' => 'yii\web\Session'
],
],
yii\console\Application::getSession()
on yii\web\Application::getSession()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question