Home > php教程 > php手册 > body text

ThinkPHP3.1.3独立分组环境下跨分组A方法调用实例

WBOY
Release: 2016-06-07 11:44:41
Original
1282 people have browsed it

ThinkPHP3.1.3独立分组环境下跨分组A方法调用实例。简单的例子,借以抛砖引玉,希望大家在使用TP过程中,通过TP官方这个交流平台分享经验,共同成长。
--------------------------------------------------------------------
什么是独立分组,请查看:
http://www.thinkphp.cn/info/177.html
什么是A方法,请查看:
http://www.thinkphp.cn/info/125.html
--------------------------------------------------------------------
独立分组:Home,Admin
--------------------------------------------------------------------
Home分组PublicAction.class.php<?php <br /> Class PublicAction extends Action {<br> <br>     Public function independentGroupTesting (){<br>         echo "独立分组A方法调用测试";<br>     }<br> }<br> ?>Admin分组Index控制器调用<?php <br /> class IndexAction extends CommonAction {<br> <br>     Public function test (){<br>         $test=A('Home/Public');<br>         $result=$test->independentGroupTesting();<br>         dump($result);<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