Home > php教程 > php手册 > tp5 rc 3 控制器的继承实例

tp5 rc 3 控制器的继承实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 11:34:37
Original
1302 people have browsed it

关于tp5 rc 3 控制器的继承实例
公共控制器 Common.phpnamespace app\index\controller;<br> use think\Controller;<br> class Common extends Controller<br> {<br>     function _initialize()<br>     {<br>        if (!session("uid")) {<br>          return $this->redirect("Login/index"); <br>        }<br>     }<br> <br> }继承公共控制器 index.phpnamespace app\index\controller;<br> class Index extends Common<br> {<br>     public function index()<br>     {<br>         return $this->fetch();<br>     }<br> <br> }

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template