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
Class PublicAction extends Action {
Public function independentGroupTesting (){
echo "独立分组A方法调用测试";
}
}
?>Admin分组Index控制器调用
class IndexAction extends CommonAction {
Public function test (){
$test=A('Home/Public');
$result=$test->independentGroupTesting();
dump($result);
}
}
?>--------------------------------------------------------------------
完成!!!是不是很简单?
AD:真正免费,域名+虚机+企业邮箱=0元
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号