Application Structure |
[eluser]M Moeen uddin[/eluser]
I m making an application, It has several feature, like blog, forum, bulletin board, Poll etc etc... Now, if i make a controller for each, and a controller to interact or load all of the model, this will be confusing or not good way? or not?. Please Tell me how to structure the application efficiently in CI. Regards, Moni
[eluser]tonanbarbarian[/eluser]
it is really up to your own taste you can make as many or as few controllers as you want i prefer to have at least 1 controller for each model (datasource) so i would definately have 1 controller for each entity/feaure on the site such as blog, forum, poll etc if you want to improve performance look at breaking large controllers into smaller controllers or move the code into multiple libraries. this means less code loaded which will improve performance overall if you prefer to put everything into just one controller that is up to you, but generally it may be harder to debug
[eluser]M Moeen uddin[/eluser]
Hmm...So One Controller..dont make rush. Ok Another thing was... Can We make a class home extend from controller with minimuim features and then start extending home to other child classes? Can we do it? Have you any idea? waiting and Thanks a lot for my first questionÅ› answer
[eluser]Dam1an[/eluser]
Yes, you can extend the Controller class with your own, and then extend that from your other controllers The default name for your super controller is MY_Controller and it would live in the libraries folder, read here for more on extending the core classes
[eluser]mikevu[/eluser]
Hey, this is structure if you like. root -application config controllers errors helpers hooks language libraries modules blog controllers language models forum views blog forum etc.. -system -index.php -.httacess - etc. |
Welcome Guest, Not a member yet? Register Sign In |