How the extension of the core classes works and where exactly's being done? |
[eluser]Unknown[/eluser]
Hello. I am currently developing a CMS (ignitioncms.net/installation/ for a install demo) and I am using Modular Extensions - HMVC and Phil Sturgeon's Template library. I want to seperate the front and back end with an administration folder (just like in Joomla!) in which the administration related templates, modules, helpers and libraries to be held. I am aming for an approach that uses CI's & HMVC's core methods such as Loader::view(), Loader::module(), Loader::helper() and so forth for logic implementation and to be sophisticated enough to understand where to search for a given module in the application or in the administration folder. In addition, when somebody wants to reach the admin folder with the 1-st segment of an URL, the URI segments have to be processed and something as array-pop to be implmeneted but to cut the 'administration' from segment(1) and to put segment(2) on its place instead and so on. I thougt a lot about an appropriate implementation and stated that I need another Admin Loader and Controller classes (and stored in e.g administration/core_override ) which extend the core classes when someone's trying to access the administration. Otherwise, the core classess should be used. The problem is that it's kinda complex to figure how everything works in the core files. I see that in the Codeigniter.php file on about 237 line the MY_Controller is called. How can I implement functionality that checks the URI with the URI class for 'administration' in segment(1) and if there is - to extend with the APPPATH.'administration/override/(Controller/Loader).php' file and extend with the MY_ one if there isn't? I'd also like to ask how the extension of the core classes work. E.g where the code for the URI extensions in being called? And how this affects the CI's super object? In Codeigniter.php file on 237 line I see that the MY_classes are being required. How exactly does that affect the system? Don't they have to be instantiated first and replace the core Controller in the CI object? I also cannot see e.g where MY_URI or MY_Loader are being called(and instanciated?). Why only by requiring the classess everything is being carried out?
[eluser]Unknown[/eluser]
Could somebody at least help me to find where are being instanciated the extensions(the MY_ classes) of the Core CI classes?
[eluser]InsiteFX[/eluser]
I posted this before but will post it again here! Code: /** Hope this helps...
[eluser]Aken[/eluser]
In the future, you may want to structure your questions to be less wordy, or at least easier to read. People aren't eager to help someone when they have to read a giant paragraph of text first.
[eluser]PhilTem[/eluser]
To be honest: I don't understand how you are able to develop a CMS without knowledge of the system in use. I have the impression that you didn't fully understand, how the business logic and the workflow in CI really works and now you want to make something in a more complex way than you would have had to if you did it correct from the beginning. See, I don't want to make you down, but I am developing a sort-of CMS based on CI, too, but before I write a lot of lines I have thoughts on how I want everything to work and I then I read into the CI files to see where I can extend what class or where there's space to hook my code into the core code. But nonetheless, I think that @InsiteFX's post is a good point for you to get started and maybe rethink your current code |
Welcome Guest, Not a member yet? Register Sign In |