删除Codeigniter CMS中的功能名称URL

when data pass in controller that time the data and function name pass into URL

localhost/project/course/Web-Development

the above example course is function name of controller but remove it and pass this URL

localhost/project/Web-Development

using remap function we can solve this problem

code in controller

public function _remap($method, $params = array())
{
    if ($method == 'autocomplete') {
        return call_user_func_array(array($this, $method), $params);
    } else {
        $methodcall = $this->M_tl_admin->Validate_Web($method);
        if ($methodcall == 'course') //***course is your function name***
            return call_user_func_array(array($this, $methodcall), array($method));
        }
}

code in model

    public function Validate_Web($alias)
{
    $res = $this->db->get_where('category', array('ctg_url' => $alias))->result_array();//category is table name and ctg_url is data pass in URL(Web-Development)
    if(count($res)>0)
         return 'course';
}

You can use route features to hide function name.

https://www.codeigniter.com/user_guide/general/routing.html

$route['product/:any'] = 'project/product_look