ThinkPHP中語言設定

2021-06-23 09:55:49 字數 493 閱讀 1314

最近乙個專案需要用英文頁面,自己對thinkphp也不是很熟,於是找了很久才知道如何設定跳轉提示中的標題

$msgtitle如何設定。在thinkphp的框架中,conf/convention.php中定義了"default_lang"=>"zh_cn",預設使用中文介面,可以在自己的專案配置檔案中更改這個引數,目前thinkphp框架中只有中文和英文,因此其他語言要自己去寫。

頁面跳轉中的成功和失敗頁面使用者可以自己定製,需要在配置檔案中定義下面兩個引數 'tmpl_action_error'和 'tmpl_action_success'=>"public:success", 框架中的'tmpl_action_error'     => think_path. 'tpl/ dispatch_jump.tpl',  // 預設錯誤跳轉對應的模板檔案'tmpl_action_success' =>  think_path.'tpl/dispatch _jump.tpl',  // 預設成功跳轉對應的模板檔案,指向了模板中的同乙個檔案。

thinkphp 3 2多語言設定

return array 配置項 配置值 lang switch on true,開啟語言包功能 lang auto detect true,自動偵測語言 開啟多語言功能後有效 default lang zh cn 預設語言 lang list zh cn,en us 允許切換的語言列表 用逗號分隔...

thinkphp配置設定

繫結資料庫資訊 配置項 配置值 url router on true,開啟路由模式 資料庫配置資訊 db type mysql 資料庫型別 db host 127.0.0.1 伺服器位址 db name tp 08 資料庫名 db user root 使用者名稱 db pwd root 密碼 db ...

thinkphp3 2 3中設定路由,優化url

需求 訪問這個目錄的時候,要重定向到 暫且這麼叫 就是看著好看 第一步 知道哪個檔案怎麼處理的路由 路由處理在think route.class.php php view plain copy 動態路由處理 routes c url route rules var dump routes if em...