use modules in the application folder |
[eluser]stijn1989[/eluser]
Hi I'm new with code igniter, but I have a question about modules. I used Zend Framework and their you could set a module structure. For example, my application structure: http://www.pastebin.be/3404 url example: http://www.mywebsite.com/forum/topic/view/325 forum = module topic = controller view = action Can I create this structure in code igniter and how do I set the controller to this structure? Thanks
[eluser]Gurkan OLUC[/eluser]
yes you can do, create a folder called forum in the controllers directory then create a new controller called topic in controllers/forum directory, and define a function in the topic contoller called view and than write whatever you want into view function.
[eluser]stijn1989[/eluser]
I'm gonna test that Gurkan OLUC, but do I have to change the $application_folder in the index.php?
[eluser]Gurkan OLUC[/eluser]
no, it is not reqired you don't have to change anything in config files
[eluser]stijn1989[/eluser]
ok thanks, but do I have to do the same thing for the models and views?
[eluser]gunter[/eluser]
to bundle the controller/modules/views of your 'module' you need to use modular separation now you can have a structure like this: application/modules/your_modulename/controllers application/modules/your_modulename/models application/modules/your_modulename/views application/modules/your_modulename2/controllers application/modules/your_modulename2/models application/modules/your_modulename2/views and you can call this then with: index.php/your_modulename/controller now you can just copy your module to another location (CI installation) with the normal CI installation you have to copy files in 3 different folders and that makes you crazy after a while I hope this helps.. |
Welcome Guest, Not a member yet? Register Sign In |