Yii2.0中实现规划任务

阅读更多
[size=x-large][size=large]1.在 console/controllers 文件夹下创建一个把握器



注:
(1)namespace console\controllers;必须有
(2)这个把握器该当应用号令行把握器的定名空间
     use yii\console\Controller;

2.如何运行

我在 windows 下应用如式格式运行

D:\xampp\htdocs\yii2>d:\xampp\php\php yii test
result :runnning success


3.如何传递参数

在 windows 中测试如下

D:\xampp\htdocs\yii2>d:\xampp\php\php yii test/send xiaoma

result:welcome to xiaoma
[/size][/size]

你可能感兴趣的:(Yii2,cron,控制台)