How to pass parameters in index function in codeigniter

后端 未结 12 1874
傲寒
傲寒 2020-12-14 03:02

here\'s an example of url: http://www.example.com/search/search-keyword

I am trying to make this work, I removed the index.php using .htaccess, search is the contro

12条回答
  •  北海茫月
    2020-12-14 03:39

    class Search extends CI_Controller{
    
        function _remap($param) {
            $this->index($param);
        }
    
        function index($param){
            echo $param;
        }
    
    }
    

    You should then be able to access that as: /search/123123 :and the page would echo out "123123" or whatever you put in place of that.

提交回复
热议问题