ThinkPHP5.0 空模块、空控制器、空操作的跳转
空模块
首先找到think\App.php,备份,然后修改:
找到【throw new HttpException(404, ‘module not exists:’ . $module);】,在它前面添加【 header(‘Location:/404.html’);die;//在此进行跳转】
空控制器、空操作
<?php
/**
* Created by PhpStorm.
* User: luozhengbo
* Date: 2018/8/27
* Time: 10:47
*/
namespace app\index\controller;
use think\Controller;
Class Error extends Controller
{
public function index()
{
return $this->page();
}
public function page()
{
return $this->view->fetch('error/page');
}
#空操作
public function _empty()
{
return $this->page();
}
}