A
A
Alexander Verbitsky2019-04-16 03:14:52
Yii
Alexander Verbitsky, 2019-04-16 03:14:52

Can't figure out cron yii2?

I have yii2 basic
when I type php path / yii test / test in the console, I write unkown command: test / test I
tried to create a test controller in the controllers folder and created the console / controllers folder, it doesn’t work either way ...
As I understand it, that when you enter the php path / yii command, a list of controllers available through the console should appear, I have this picture:
5cb51e57a9b00789812891.png
And I can’t even imagine how to add test / test there ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gip, 2019-04-16
@VerbAlexVlad

You need a controller that inherits from yii\console\Controller
in the advanced template, it is usually located in console\controllers, in basic in commands
and pay attention to your yii.php which you call, what application is going there, it should be:
$application = new yii \console\Application($config);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question