0

I want to route controllername/variable to controllername/methodename/variable

routes.php

$route['controllername']="controllername/methodename";

but it does not work !

How to route with variable?

2 Answers 2

1

Try this,

$route['controllername/(:num)'] = 'controllername/methodename/$1';

Check this also : https://ellislab.com/codeigniter/user-guide/general/routing.html

Sign up to request clarification or add additional context in comments.

1 Comment

(:num) not worked my variable contain characters. I used (:any) then it work. But other metherds in that controller not worked
0

try like it

$route['controllername/:num'] = 'controllername/methodename';

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.