A
A
Artur Aralin2014-03-19 18:14:18
CodeIgniter
Artur Aralin, 2014-03-19 18:14:18

CodeIgniter - how to properly route?

Hello!
My problem is this: I have 2 controllers main && posts , and I need to be able to access the standard controller (without specifying the controller itself) site.ru/methodname , and the rest of the controllers - specifying them in the URL site.ru/ controller/methodname

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Shatilov, 2014-03-19
@iproger

Write down a rule for each case.
If you need it for pages, then I advise you to register
A for everything else, it will work as it worked.

D
dyudya, 2014-03-23
@dyudya

Below all other routes, write
Or, if you have methodname with parameters, then
$route['(:any)/(:any)'] = 'tvoy_controller/$1/$2';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question