基础控制器: 引入了 App Request对象
<?php
namespace app\controller;
class Zikzq extends BaseController{
public function index(){
return "子控制器";
}
public function getfun(){
$action = $this->request->action();
$path = $this->app->getBasePath();
}
}
空控制器:
<?php
namespace app\controller;
class Error {
public function index(){
return "controller不存在";
}
}
访问:http://www.tp.com/public/index.php/demo1
controller不存在
多级控制器:
新建 /controller/djkzq/
<?php
namespace app\controller\djkzq;
class Come{
public function index(){
return "多级控制器";
}
}
访问:http://www.tp.com/public/index.php/djkzq.come/index