Welcome Guest, Not a member yet? Register   Sign In
user guide, faq and layouts - I'm lost :(

hi noobcode,

welcome to CI!

yes, in general it is OK to put your db access code in the controller when you are first trying out CI. but, as you progress, you will find that most people build a "model" and keep all of the db code in there and pass the results back to the controller.

the "problem" with CI is that you have to learn what architecture suits you (and your application) best. there are so many ways to set things up that it can get confusing to know which is best. my advice is to just try one way that seems straightforward and try it to see.

in any case, don't put db access code in the view - it will ruin your future days.

as for your last question, it sounds like you might want to look at a template library. or maybe just use the returned value from views called in a controller to build your layout.


Thanks to all, i also new here so i get the basic info. thanks..... Smile

Theme © iAndrew 2016 - Forum software by © MyBB