Home > PHP Framework > YII > How to implement scheduled message push in yii2

How to implement scheduled message push in yii2

(*-*)浩
Release: 2019-12-14 10:04:25
Original
2525 people have browsed it

How to implement scheduled message push in yii2

Yii2’s scheduled tasks can be written in two ways. The principle is to call them through the server’s scheduled tasks

1. Through Calling the specified URL is equivalent to accessing in the browser (Recommended learning: yii framework)

2. Call through console

Let’s talk about how Console implements scheduled tasks

First create a Controlle and inherit yii\console\Controller;

<?php
namespace console\controllers;
use yii\console\Controller;
class TestController extends Controller {
public function actionIndex()
{
echo "hello world";
}
}
Copy after login

How to implement scheduled message push in yii2

The above is the detailed content of How to implement scheduled message push in yii2. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template