【发布时间】:2018-03-23 06:57:28
【问题描述】:
我有一个控制器 Leads,有两个功能
- 索引
- 潜在客户详情
这是我的代码
class Leads extends CI_Controller {
public function index(){}
public function lead_details($slug){}
如下所示
www.mysite.com/leads/ This will access to index function
www.mysite.com/leads/lead_details/nice-not-to-have-2
现在我想获取详细信息,例如
www.mysite.com/leads/nice-not-to-have-2
我试过了,但它与索引功能混淆
$route['leads/(:any)'] = 'leads/lead_details'
注意:这不是this的重复
问题在于索引功能。我如何使用 application/config/routes.php 来做到这一点?
示例:leads/index 指向lead_details 函数时给我错误
【问题讨论】:
标签: php codeigniter routes