How to pass parameters in index function in codeigniter

后端 未结 12 1876
傲寒
傲寒 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:32

    You should use the CI URI Class. http://codeigniter.com/user_guide/libraries/uri.html

    
    class Search extends CI_Controller{
    
         function index($param){
            //echo the search-keyword
            echo $this->uri->segment(2);
         }
    
    }
    

提交回复
热议问题