[英]Issue with URL in CodeIgniter
我在汽車上的網站遇到問題-現在我在CodeIgniter上遇到的問題是,如果我選擇“制造”,則在“新車”部分中,URL如下所示。
但我想要這樣的網址。
同樣,在同一頁面上的優化搜索中也遇到了問題,即如果我選擇兩輛車,URL不會改變,但參數會改變。 有沒有辦法讓它沒有參數。
$ input1 = $ this-> input-> post('user_search1'); $ input2 = $ this-> input-> post('user_search2');
$ user_input =數組($ input1,$ input2); //制作用戶搜索數組輸入$ search_field_name = array(“ search_col_name1”,“ search_col_name2”); //進行搜索的表的原始列名
//合並后作為uri發送$ searchparams_uri = array_combine($ search_field_name,$ user_input);
//如果Values為null或未設置,則從數組中刪除鍵和值。$ searchparams_uri = array_filter($ searchparams_uri);
//將關聯數組$ this-> terms_uri轉換為要附加到base_url的段$ keys = $ this-> uri-> assoc_to_uri($ this-> terms);
$ this-> load-> library('pagination'); $ config ['base_url'] = base_url()。'index.php / controller / method_name /'.'/'.$ keys。'/';
您將獲得如下URL:index.php / controller / method_name / search_col_name1 / input1 / search_col_name1 / input1
根據您的需要進行折斷和制作。 歡迎提問。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.