<pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

          <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

          <p id="bbfd9"></p>

          <p id="bbfd9"><cite id="bbfd9"></cite></p>

            <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

            <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
            <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
            php語言

            分析thinkphp常見路徑用法分析

            時間:2025-02-28 11:55:44 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:http://www.test.com/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

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

              復制代碼 代碼如下:

              //項目公共目錄

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

              //網站公共目錄

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

              //網站根目錄

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

              //當前項目地址

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

              //當前模塊地址

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

              //當前項目操作地址

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

              //當前頁面操作地址

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

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

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

            ThinkPHP中redirect用法實例分析09-26

            thinkPHP簡單遍歷數組方法分析09-10

            分析PS中的圖層、通道及路徑08-29

            php中引用的用法分析06-22

            Java中的多態用法實例分析10-23

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

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

            主板的常見故障分析10-21

            主板常見故障分析11-08

                    <pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

                    <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

                    <p id="bbfd9"></p>

                    <p id="bbfd9"><cite id="bbfd9"></cite></p>

                      <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

                      <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
                      <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
                      飘沙影院