1

I am trying to do this route trick:

$route['cp/roles/:num'] = "cp/roles/index/:num";

but it doesn't work :( please help me!!

advanced thanks .

2 Answers 2

3

According to the documentation on URI Routing:

$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";

A URL with "product" as the first segment, and a number in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

So, for your particular instance, you would do the following:

$route['cp/roles/(:num)'] = "cp/roles/index/$1";
Sign up to request clarification or add additional context in comments.

Comments

0

You could try

$route['cp/roles/:num'] = "cp/roles";

and then instead of passing a variable in your function you use

$this->uri->segment(3);

or the number that correspond to the segment.

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.