CodeIgniter Forums
Change structure in the CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Change structure in the CI (/showthread.php?tid=52610)



Change structure in the CI - El Forum - 06-18-2012

[eluser]Unknown[/eluser]
Hello everybody,

I was asked to change structure in the CI, it like this:


In each controller, each with its own directory , each directory has the file controller.
- Normally, each time when running, we call to directory that contains the file Controller, then calling Class controller and Method, ...
- And now just call an alias , it is self-understanding is pointing to any directory, any class . (Each alias will replace a directory, a class)

Example: Suppose there Listtype folder (directory Controller), including file Category (category.php).

=> call in the normal way :
Quote:http://localhost/demo/index.php/listtype/category/method/


And just call "alias"

Quote:http://localhost/demo/index.php/alias/method /

In it, "alias" will replace listtype / category. I have used in the configuration file (route.php) but not correct

Quote:$route['alias/(:num)'] = "listtype/category/$1";

But I think it doesn't work all cases (as if there are more variables in each segment, ...)
Please help me solve this problem, thanks very much

Sorry my English.