Welcome Guest, Not a member yet? Register   Sign In
Change structure in the CI
#1

[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...ry/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.


Messages In This Thread
Change structure in the CI - by El Forum - 06-18-2012, 08:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB