Welcome Guest, Not a member yet? Register   Sign In
How to arrange the code for website
#1

[eluser]Unknown[/eluser]
Hello everyone, I am new one and have been using codeigniter since a few days... Before I did some pages in XHTML et PHP5. My question is - how to arrange the code in appliation>controller for a simple website with about 10 pages? - do we should make many classes (like one for each page) or many functions in the main class? Ant the second thing that doesn't let me sleep is the object way to deal with the database - I use UML to modelise the tables, the relations, and then build the code.
With PHP5 each time i create the list of variables in the page that suppose to use them, now with CI should I put them all in main class? Plese advise and if it's possible send me some examples. Thank you in advance...
#2

[eluser]ojcarga[/eluser]
I think the best way is to have one controller for each page cause there you will have the functionality for each one allowing you to have the code ordered and if there is a common functionality for some of them you should use a helper or a library in order to re-use the code.
#3

[eluser]InsiteFX[/eluser]
See the news example in the CodeIgniter Users Guide!




Theme © iAndrew 2016 - Forum software by © MyBB