Welcome Guest, Not a member yet? Register   Sign In
Can I pass URL variables to the index function of a controller ?
#1

[eluser]sirwan.me[/eluser]
Can I pass URL variables to the index function of a controller ?

for example :
Code:
class Post extends Controller {

    function Post()
    {
        parent::Controller();    
    }
    
    function index($username="", $slug=""){
        $this->load->view('header');
        
        $this->load->model('post_model');
        $data['query'] = $this->post_model->get_post($username, $slug);
        
        $this->load->view('post', $data);
        $this->load->view('footer');
    }
}


Messages In This Thread
Can I pass URL variables to the index function of a controller ? - by El Forum - 06-18-2010, 04:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB