如果我有這樣一種形式:做使用URI段中的CodeIgniter GET請求
<form method="GET">
<input type="text" name="search" />
</form>
,如果我提交它,它會產生這樣的URL:http://exmaple.com/search/results?search=text1+text2
現在,這並不使用我的代碼。我如何使其使用URI段,所以生成的URL看起來是這樣的:http://exmaple.com/search/results/search/text1+text2
更多的澄清 換句話說,我想的是,當我用一個簡單的HTML形式的GET請求的URL它產生看起來像CodeIgniter的URL使用笨路由即example.com/class/function/param1/param2
而不是example.com/class/function?param1¶m2
你嘗試過在使用CodeIgniter的路線? 'http:// ellislab.com/codeigniter/user-guide/general/routing.html' –
以及我剛剛嘗試添加此路線:'$ route ['search/results?search =(:any)'] =「search/results/search/$ 1「;'但它不起作用 – Krimson
試試這個'$ route ['search/results/search /(:any)'] =」search/results?search = $ 1「'你切換了它們。 –