網址:http://localhost/thinkphp/public/index/Be/demo1/name/think
———————————————————— ——————————
namespace app\index\controller;
#class Be extends \think\Controller
{
## protected $beforeActionList = [
//這裡是前置方法
'before1' => '',
// 'before2'=> ## //'before3'=>['except'=>'demo3,demo1'],
];
protected $siteName
#/#/#前置方法
protected function before1()
{
$this->siteName =$this->request-> # protected function before2()
{
# $this->siteName = '百度中文網2';
}#
$ this->siteName = '網易3';
}
public function demo1()
{
public function demo1()
{
# return $this->siteName ## # return $this->siteName ##
# public function demo2()
{
# return $this->siteName;
}
;
}