php - How do I create a console command (rake task) in Yii2? -
i used gii create file, cannot execute console!
controllers/kwcontroller.php <?php namespace app\controllers; class kwcontroller extends \yii\console\controller { public function actionindex() { return $this->render('index'); } } when try run it, fails.
$ yii kw error: unknown command "kw". $ yii kw error: unknown command "kw". $ yii kw error: unknown command "kw". $ yii kw/index error: unknown command "kw/index". the guide of no help, in order.
http://www.yiiframework.com/doc-2.0/guide-tutorial-console.html
i had put file in commands/ path , change namespace. weird, docs don't mention @ all. , why did gii put there?
Comments
Post a Comment