zoukankan      html  css  js  c++  java
  • A函数跨区域

    ODerController.class.php内容如下 

    1
    <?php 2 3 /* 4 * To change this license header, choose License Headers in Project Properties. 5 * To change this template file, choose Tools | Templates 6 * and open the template in the editor. 7 */ 8 9 namespace HomeController; 10 use ThinkController; 11 class ODerController extends Controller{ 12 //未付款的信息 13 public function gwc(){ 14 echo dddd; 15 } 16 }
     UserController.class.php内容如下:
    1
    <?php 2 3 /* 4 * To change this license header, choose License Headers in Project Properties. 5 * To change this template file, choose Tools | Templates 6 * and open the template in the editor. 7 */ 8 9 10 11 namespace HomeController; 12 use ThinkController; 13 class UserController extends Controller{ 14 15 public function info(){ 16 // echo '5555'; 17 /* 18 * 跨控制器调用,现在是自己在调用 19 20 $order = new HomeControllerODerController(); 21 $order->gwc(); 22 */ 23 24 /*跨控制器调用,使用A()函数 25 $order=A('Home/ODer'); 26 *dump();tp系统函数,开发小组自己用的,带有格式的输出 27 *dump($order); 28 * $order->gwc(); 29 */ 30 } 31 }

    备注:

    A函数
        作用:实例化控制器的一个快捷函数

        格式:A(模板/控制器,[控制器层名称]);

      跨控制器调用

        本次练习是在ThinkPHP_3.2_140202下操作的

  • 相关阅读:
    Day 19
    Day 18
    Day17
    Day 16
    正则表达式(仅可输入中文英文数字以及英文逗号)
    Linux安装Nginx 并搭建图片服务器
    Mysql创建用户表并利用存储过程添加100万条随机用户数据
    Dubbo(高性能、轻量级的开源Java RPC框架) & RPC(远程过程调用)
    Redis
    OSI (开放系统互联(Open System Interconnection))
  • 原文地址:https://www.cnblogs.com/StinkyKids/p/6439793.html
Copyright © 2011-2022 走看看