形如 index.php/explore-page/colors/pink-color 的地址欄 應該怎麼理解?

來源:互聯網
上載者:User
以前所接觸過的連結地址是形如:index.php?key1=val1&key2=val2
但是在 index.php/explore-page/colors/pink-color 中 哪個是參數名稱 哪個是值呢?


回複討論(解決方案)

這個是人家架構路由定義好的。
具體要看路由是怎麼定義的

explore-page/colors/pink-color
探討頁 /顏色 /粉色

具體怎麼解釋,由開發人員決定

還是有點不太明白
我使用的是joomla 裡面的連結很多都是那壓根的 是什麼意思哦

index.php/explore-page/colors/pink-color
這是 path_info 格式的 url
其中
index.php 是處理常式
/explore-page/colors/pink-color 是傳遞的參數
每一節代表一個參數,這裡就是 3 個了

程式從 $_SERVER['PATH_INFO'] 取得參數串後,按 / 切割成數組
如何解釋數組元素的含義,有開發人員就定
程式是你寫的,就由你決定
即:參數是按位置解釋的

而 index.php?key1=val1&key2=val2
參數是按名稱解釋的

index.php/explore-page/colors/pink-color
這是 path_info 格式的 url
其中
index.php 是處理常式
/explore-page/colors/pink-color 是傳遞的參數
每一節代表一個參數,這裡就是 3 個了

程式從 $_SERVER['PATH_INFO'] 取得參數串後,按 / 切割成數組
如何解釋數組元素的含義,有開發人員就定
程式是你寫的,就由你決定
即:參數是按位置解釋的

而 index.php?key1=val1&key2=val2
參數是按名稱解釋的



這下子就清楚多了 謝謝版主 。。

index.php/explore-page/colors/pink-color
估?是rewrite成
index.php?action=explore-page&colors=pink-color

具?你要看看是怎??rewrite的。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.