Home >Backend Development >PHP Tutorial >php request request operation

php request request operation

不言
不言Original
2018-04-13 09:24:408526browse

The content shared with you in this article is about the request operation in PHP. Friends in need can refer to it


##

class User extends Controller
{
    protected  $beforeActionList = [
        'init',
        'checkLogin' => ['except' => 'login'],
        'onlyindex' => ['only' => 'index'],
    ];

    public function _empty($name){
        echo "您访问的方法".$name;
    }

    public function init(){
        echo "执行了前置方法init<br>";
    }

    public function login(){
        echo "user/login";
    }

    public function checkLogin(){
        echo "检测login方法";
    }

    public function onlyindex(){
        echo "独占的方法";
    }

    //初始化的方法
    public function _initialize()
    {
        echo "在控制器初始化的时候执行<br>";
    }

    public function index(){
        return "User/index";
    }

    public function getUserInfo(){
        return "获取用户信息的方法";
    }
}

Related recommendations:

AJAX XMLHttpRequest object usage detailed explanation

H5 timer requestAnimationFrame usage tips



The above is the detailed content of php request request operation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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