CodeIgniter用GET方式傳值

2021-08-25 16:57:53 字數 500 閱讀 8826

ci預設過濾了$_get

需要傳遞get引數時一般直接 /引數一/引數二

詳見手冊說明:

但是有時候需要傳遞很長的複雜的url,比如常用的

這時 這種模式就行不通了。引數中本身的/會與預設的分隔符衝突

解決方案:

1) 在config.php 中,將『uri_protocol』 設定為 『path_info』.

php

$config

['uri_protocol']=

"path_info";

複製**

2) 在需要使用$_get的之前加:

php

parse_str

($_server

['query_string'],

$_get);

複製**

這樣,形如 index.php/blog/list?parm=hello&page=52 就可以執行了

Codeigniter 基本配置

config base url config index page index.php codeigniter 根目錄下的 index.php 檔名,codeigniter 會使用它來生成鏈結位址。如果使用隱藏 index.php 的 url,將其設定為空字串 config index page c...

CodeIgniter使用總結

最近在使用codeigniter開發乙個企業站專案,一開始是把前台和後台分開作為兩個單獨的專案,但後來想想為啥不能放在乙個專案裡呢,便有了改造的想法。先上一張最終的目錄結構圖 config routes.php controllers backend frontend core my control...

CodeIgniter框架介紹

入口 index.php 一些路徑常量定義 codeigniter.php 1.初始化一些 system core內的類,例如config,utf8,uri 和router等,router.set routing 處理路由對映。2.全域性函式get instance,取controller例項引用,...