Welcome Guest, Not a member yet? Register   Sign In
Any one help please??
#2

[eluser]PhilTem[/eluser]
There are multiple ways, some of them are better/easier/worse/...

1) Add a route before the (:any) route for every controller you want to access which shall not be static
2) Create a "bootstrap" controller which will replace the "page/view/$1" controller to handle all requests. Inside this you will check first if there is a controller (file) in application/controllers for the first URI-segment. If you found one, load the class (be careful, this one must not extend CI_Controller or MY_Controller since you will get all classes double loaded and will loose data) and see if there is a method equivalent to the second URI-segment. Then you execute this method and return its content. On the other hand, if you didn't find the method, do show_404();. For classes/files/first URI-segment not found as file, try to find the content either in a view file or inside the database (whichever way you store you static content)
3) There was actually a third possibility which I have, however, forgotten Tongue

I personally like method 2 most but it requires some different code to work (since your controllers shall not extend MY_/CI_Controller but still need to be able to access every component of CI (key word get_instance().


Need further help? Send me an email/PM!


Messages In This Thread
Any one help please?? - by El Forum - 09-07-2012, 05:53 AM
Any one help please?? - by El Forum - 09-07-2012, 06:02 AM
Any one help please?? - by El Forum - 09-07-2012, 06:22 AM
Any one help please?? - by El Forum - 09-09-2012, 05:12 AM
Any one help please?? - by El Forum - 09-09-2012, 05:14 AM
Any one help please?? - by El Forum - 09-09-2012, 05:18 AM
Any one help please?? - by El Forum - 09-09-2012, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB