Laman web: http://localhost/thinkphp/public/index/Be/demo1/name/think
——————————————————————————— —— aNamespace AppindexController;
Class be extends ThinkController
Protected $ BeForeACTIONLIST = [
// Berikut ialah kaedah hadapan
'beFore1' = & GT; 'sahaja' = & gt; 'demo2'],
// 'beFore3' = & GT ['Kecuali' = & GT; Tulis pra-kaedah di sini
fungsi dilindungi before1()
{
$this->siteName =$this->request->param('name');
}
protected function before2()
{
$this->siteName = 'Baidu Chinese Network 2';
}
fungsi yang dilindungi sebelum3()
; ;
}
demo2 majlis awam () {
Kembalikan $ ini- & gt; nama tapak;
Mana nak dapatkan kaedahnya?