S
S
Sergey Beloventsev2017-09-26 09:54:23
Yii
Sergey Beloventsev, 2017-09-26 09:54:23

What's wrong with the console command?


created in folder console/controller

<?php
namespace console\controllers;
use yii\console\Controller;
class earningsController extends Controller
{
    public function actionCreate()
    {
        return "yes"
    }
}

I try to call php yii earnings/create
I get Unknown command: earnings/create
I do this
...
- earnings                     
- fixture  ...

tell me what I'm doing wrong?
corrected the name of the controller now it looks like this
namespace console\controllers;
use yii\console\Controller;
class EarningsController extends Controller
{
    public function actionCreate()
    {
        return "yes";
    }
}

php yii outputs
- earnings          
    earnings/create

write php yii earnings/create get response
Unknown command: earnings/create

Did you mean "earnings/create"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Agafonov, 2017-09-26
@Sergalas

Unknown command: earnings/create
Did you mean "earnings/create"?

I bet bitcoin that there is Cyrillic somewhere in the name of the method or controller

D
Dmitry, 2017-09-26
@slo_nik

Good morning.
In the console, execute php yiiand see the list of commands that is available. You may be entering the command incorrectly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question