2017-02-18 122 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