Page 1 of 1

Tips on code organization

Posted: Mon May 28, 2012 5:01 pm
by Live24x7
Developing my most complex php script so far.
As the number of files and code get larger the question of how to organize them comes up

so far i have 4 folders

1) user manageent folder - logins/logouts
2) the core processes folder
3) the design folder (Views)
4) classes

I am not looking for any specific tip..but rather any thing that you have learned over the years with experience as to what works best.

Things like:

what should be placedin the root folder and what goes into separate folder ?

and anything related to this.

thanks

Re: Tips on code organization

Posted: Tue May 29, 2012 3:15 am
by social_experiment
if you haven't already done this take a look at existing cms for ideas on file structures

Re: Tips on code organization

Posted: Tue May 29, 2012 11:37 am
by Live24x7
thats a nice suggestion will look at wordpress or joomla structure

Re: Tips on code organization

Posted: Tue May 29, 2012 11:41 am
by Celauran
You'd probably do better to look at the file layout of a PHP Framework. Most CMSes I've encountered are frightfully poorly written. They're good at what they do, but I wouldn't use them as references for best practices.

Re: Tips on code organization

Posted: Tue May 29, 2012 12:57 pm
by Live24x7
Thanks ..Inspecting the code structure of CI - and i see reasons why MVC is better for code modification and extensibility