本文实例讲述了Yii2框架使用计划任务的方法。分享给大家供大家参考,具体如下: <?php namespace console\controllers; use yii\console\Controller; /** * Test controller */ class TestController extends Controller { public function actionIndex() { echo "cron service runnning"; } public function actionMail($to) { echo "Send