<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            分析thinkphp常見路徑用法分析

            時間:2026-01-01 09:15:07 php語言

            分析thinkphp常見路徑用法分析

              文章主要介紹了thinkphp常見路徑用法,實例分析了__PUBLIC__、__ROOT__、__APP__、__URL__、__ACTION__及__SELF__等標簽常量的用法,需要的朋友可以參考下.就跟隨百分網小編一起去了解下吧,想了解更多相關信息請持續關注我們應屆畢業生考試網!

              本文實例分析了thinkphp常見路徑用法。分享給大家供大家參考。具體如下:

              這里介紹的標簽主要有: __root__ __self__ __action__ __url__ __app__ __public__

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

              假如當前模塊是:Index

              假如當前操作是:index

              那么首頁完整的URL:/pic/other/Form/index.php/Index/index

              1 __ROOT__:/other/thinkphp/mydemo

              2 __SELF__:/other/thinkphp/mydemo/Form/index.php

              3 __ACTION__: /other/thinkphp/mydemo/Form/index.php/Index/index

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

              5 __APP__: /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

              模板中對路徑部分的操作是這樣子的:

              復制代碼 代碼如下:

              /pic/p>

              $tmplContent = str_ireplace('../public',APP_PUBLIC_URL,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__PUBLIC__',WEB_PUBLIC_URL,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__ROOT__',__ROOT__,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__APP__',__APP__,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__URL__',__URL__,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__ACTION__',__ACTION__,$tmplContent);

              /pic/p>

              $tmplContent = str_replace('__SELF__',__SELF__,$tmplContent);

              希望本文所述對大家基于ThinkPHP框架的PHP程序設計有所幫助。

            【分析thinkphp常見路徑用法分析】相關文章:

            ThinkPHP中redirect用法實例分析02-08

            thinkPHP簡單遍歷數組方法分析03-16

            分析PS中的圖層、通道及路徑01-19

            php中引用的用法分析03-04

            主板的常見故障分析12-30

            電腦主板常見的故障分析12-16

            主板常見故障分析12-15

            php中return的用法實例分析10-12

            Java中的多態用法實例分析12-03

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看