频道栏目
首页 > 资讯 > ThinkPHP > 正文

thinkphp路径

16-01-06        来源:[db:作者]  
收藏   我要投稿

标签: __root__ __self__ __action__ __url__ __app__ __public__

假如你项目首页的URL是:www.test.com/other/Form

假如当前模块是:Index

假如当前操作是:index

那么首页完整的URL:http://www.test.com/other/Form/index.php/Index/index

1:/other/thinkphp/mydemo

2/Content/thinkphp_LuJing.html:/other/thinkphp/mydemo/Form/index.php

3/Article/content: /other/thinkphp/mydemo/Form/index.php/Index/index

4/Article: /other/thinkphp/mydemo/Form/index.php/Index

5: /other/thinkphp/mydemo/Form/index.php

6/Public:/other/thinkphp/mydemo/Public

7../public(不区分大小写):/other /thinkphp/mydemo/Form/Tpl/default/Public

8. APP_PUBLIC_URL:/other/thinkphp/mydemo/Form/Tpl/default/Public

9. WEB_PUBLIC_URL:/other/thinkphp/mydemo/Public

模板中对路径部分的操作是这样子的:

  1. //项目公共目录 $tmplContent=str_ireplace('../public',APP_PUBLIC_URL,$tmplContent);
  2. //网站公共目录 $tmplContent=str_replace('/Public',WEB_PUBLIC_URL,$tmplContent);
  3. //网站根目录 $tmplContent=str_replace('',,$tmplContent);
  4. //当前项目地址 $tmplContent=str_replace('',,$tmplContent);
  5. //当前模块地址 $tmplContent=str_replace('/Article',/Article,$tmplContent);
  6. //当前项目操作地址 $tmplContent=str_replace('/Article/content',/Article/content,$tmplContent);
  7. //当前页面操作地址 $tmplContent=str_replace('/Content/thinkphp_LuJing.html',/Content/thinkphp_LuJing.html,$tmplContent);
相关TAG标签
上一篇:PHP用CURL伪造IP和来源
下一篇:配置PHPStorm IDE集成Yii框架教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站