如何从基于Web的cron作业创建和管理

I need help completing my project. My project is to control the light through the website using Raspberry Pi. The lamp should be able to set the schedule when ON and OFF via website (Yii2 Framework). And now the problem is, I do not know or understand how to create and manage the lamp lamp schedule through website (Yii2 Framework). I need help to solve the problem.

You may try to use yii2tech/crontab extension for this:

use yii2tech\crontab\CronJob;
use yii2tech\crontab\CronTab;

$cronJob = new CronJob();
$cronJob->min = '0';
$cronJob->hour = '0';
$cronJob->command = 'php /path/to/project/yii some-cron';

$cronTab = new CronTab();
$cronTab->setJobs([
    $cronJob
]);
$cronTab->apply();