thinkphp3.x自定义Action、Model及View的简单实现方法.docxVIP

  • 4
  • 0
  • 约1.15千字
  • 约 1页
  • 2021-01-13 发布于山东
  • 举报

thinkphp3.x自定义Action、Model及View的简单实现方法.docx

本文实例讲述了 thinkphp3.x 自定义 Action 、Model 及 View 的实现方法。分享给大家供大家参考,具体如下: 1、在 xmall/Lib/Action 中创建文件 TestAction.class.php class TestAction extends Action{ nbsp; nbsp;function index(){ nbsp; nbsp; $this-gt;display(test); nbsp; nbsp;} } 2、在 xmall/tpl 下创建 default 文件夹 ,在 default 下创建 Test 文件夹,在 Test 下创建 test.html 模版文件; 3、执行  URL :http://localhost/xmall/index.php/Test/index  就会出现  test.html  页面的内容 4、在操作过程中出现的错误: (1) URL 中的 Test 的 T 要大写; (2) Display 不需要提供文件的扩展名,默认为  index 5、注意事项: 为方便调试,应在 index.php 入口文件中添加 define(APP_DEBUG,true); (2) 最好在配置文件 (xmall/Conf/config.php) 中指定默认模版: DEFAULT_THEME =gt; de

文档评论(0)

1亿VIP精品文档

相关文档