We have to setup a cron job for our project. Whenever we call ApplicationConfigs component from the console command, the code throws below error -
Exception ‘yii\base\UnknownPropertyException’ with message ‘Getting unknown property: yii\console\Application::homeUrl’
The code is Yii::$app->homeUrl.’/js/’ where we try to set path for js folder.
Is there any way we can get Yii::$app->homeUrl in console? Other component files are running properly from console commands.