Welcome Guest, Not a member yet? Register   Sign In
Basic question about CI - lucidity of files
#1

[eluser]4ever[/eluser]
HI,
I started to learn CI with help of some video tutorials. However the programming I see of author seems to me a little chaotic. I can't imagine that. I would made a great site with many forms, actions for sending them, searching scripts, etc and all this things I would place to just three folders: application/controllers,application/models,application/views ... so that would be really chaotic. So I ask you can you build subdirectories to assort the files according its purpose?

For example:
application/controllers/forms/all my forms here...
application/models/form_send/all my form actions here...
application/models/search/models to search in database
application/views/forms/forms views here
application/views/pages/view of separated pages on my site
application/views/profiles/profiles of users here
application/views/posts/users posts views here

or do you just mix all files together?
#2

[eluser]eoinmcg[/eluser]
i agree that it does get rather unwieldy, particularly for larger apps.

thanksfully there is a great addition to CI:
https://bitbucket.org/wiredesignz/codeig...c/overview

this will allow you to group functionality in modules.
#3

[eluser]4ever[/eluser]
[quote author="eoinmcg" date="1305646902"]i agree that it does get rather unwieldy, particularly for larger apps.

thanksfully there is a great addition to CI:
https://bitbucket.org/wiredesignz/codeig...c/overview

this will allow you to group functionality in modules.[/quote]

Thanx I will try.

I thought about that it could be simple to use such code like

Code:
$this->load->module('forms/login');
$this->load->module('forms/register');
$this->load->module('forms/search');
or to load them all at once>
$this->load->module('forms/');
$this->load->view('forms/');
or maybe complicated things like
$this->load->module('forum/forms/');
to determine where the modules are placed or to load all files in subdirectory.

If IC programmers would implement this feature it would be great. That the load class should to identify whether the string has slashes and if a slash is on the end of string then to go through the directory and load all files in it. I think this should be simple code, few lines... Shorter than the code of HMVC... Without using eval command!
#4

[eluser]4ever[/eluser]
HMVC

I think I will better try to program own solution for loading modules. On the principle above.
#5

[eluser]eoinmcg[/eluser]
Quote:I think I will better try to program own solution for loading modules. On the principle above.

whatever floats your boat. should be quite simple to achieve, by adding a module method to the the loader class.




Theme © iAndrew 2016 - Forum software by © MyBB