2017-02-18 114 views
0

codeigniter中,我使用get方法來搜索數據列表。如何在codeigniter的url中傳遞搜索參數

我的配置是

在config.php

$config['index_page'] = ''; 

的.htaccess

<IfModule mod_php5.c> 
php_value max_execution_time 30000 
</IfModule> 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

我的搜索

http://localhost/store/customer/index?limit=20&search_name=&search_mobile=&search_due= 

的URL結果

404頁未找到。

如何使這項工作不index.php

+0

是指數在客戶控制器的功能?我的意思是什麼是控制器名稱和方法名稱 – rahulsm

+0

客戶是控制器和方法是索引 –

+0

要索引方法我想通過搜索參數 –

回答

0

笨提供清潔URLS設施。你可以解決的問題像下面。

裏面有​​3210控制器功能index與參數:

function index($limit="",$search_name="",$search_mobile="",$search_due="") 
{ 
//code 
echo $limit;//prints 20 
} 

然後傳遞參數的功能這樣的..

http://localhost/store/customer/index/20/search_name/search_mobile/search_due