路徑與大小寫

2021-09-24 16:00:32 字數 985 閱讀 7844

因為在linux環境下 路徑是區分大小寫的,而windows下是不區分的.再加上thinkphp中__url__總反回小寫,因此路徑常有弄不好大小寫的情況.

現在用乙個方案去解決這個問題. 配置令程式全部區分大小寫,並使用最"安全"的命名方案.如下

2.'url_case_insensitive' =>false, 使得url 區分大小寫(預設也為false)

<?php

require '../thinkphp313frame/thinkphp.php';

3.(1)adminmodelaction.class.php 第乙個字母用大寫,其它用小寫(也就是把多個單詞也當作乙個單詞),也不要用下劃線

(2)f***xaction.class.php

(3)類名也為f***xaction

(4)類下面的方法全部用小寫(可用下劃線)

(5)此時 對應的模板資料夾首字母也大寫

//---例如:模組使用者新增模組,user add

控制器命名為 useraddaction.class.php(而不是useraddaction.class.php)

對應的類為 class useraddaction extends action

public function do_add(){}

對應的模組/tpl/admin/graytheme/useradd/add.html

4.到部署時,為了 再設定'url_case_insensitive' =>true,

5.附:此時模板中__group__  __url__ 代表的路徑 

__group__ 當前分組的url位址 group

__url__ 當前模組的url位址 url

轉到同一action.class.php 的其它方法時用 __url__

轉到其它action.class.php時用__group__

__group__/adminmodeladd/add/?groupid=&model=

mysql 區分大小寫 大小寫敏感 配置

linux下mysql預設區分大小寫 windows下mysql預設不區分大小寫 檢視是否區分大小寫 lower case table names引數詳解 lower case table names 0 其中 0 區分大小寫,1 不區分大小寫 mysql在linux下資料庫名 表名 列名 別名大小...

ASP中的區分大小寫與不區分大小寫

asp中的變數,關鍵字不區分大小寫,這誰都知道。但在有些地方又是區分大小的。在下面這種密碼驗證時就不區分大小寫,這樣就增加了asp不安全因素 select from admin where username username and password password 這時的 password 的值...

大小寫轉換

小寫數值轉大寫 xieshuxu 傳入轉換字串 傳入整數單位 如 元 傳入小數點後一位單位 如 角 傳入小數點後兩位單位 如 分 public string xiaotoda string xiao,string one,string two,string tree if xiao.indexof ...