0

I want to pass two parameters in index function using codeigniter but its giving me error i don't know why its giving me error. here is my controller

function index($one = null,$two = null)
{
    $data['title'] = "Product Page ";
    $this->load->view('home/header/header',$data);
    $this->load->view('home/css/css');
    $this->load->view('home/navbar/navbar2');
    $this->load->view('products/product');
    $this->load->view('home/footer/footer');
    $this->load->view('home/js/js');
}

here is my routes setting

$route['product/(:any)'] = 'product/index/$1'; 

When i set my index function in one parameter its working fine but its not working with two parameters.

1 Answer 1

4

You can try with this, it will be working

$route['product/(.*)/(.*)']='product/index/$1/$2';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.