Welcome Guest, Not a member yet? Register   Sign In
How do I have a global array in __construct() ?
#5

(08-03-2017, 06:15 AM)Martin7483 Wrote: Your code is very messy. Look into using models. You shouldn't write queries in the constructor of a Controller

(08-04-2017, 08:51 AM)rtenny Wrote: I can only agree with Martin7483. Stop immediatly and start leaning to programm. Read some of the funamental tutorials and principals.
You are trying to run before you can even crawl. Just because you can drive a car does not mean you can start building a racing car.

I found a good tutorial on object orientated programming on envato net tuts which explains how to do it with more OOP concept.s

The thing with programming is that there is so much that one could possibly know about it, that one cannot learn it all, so I only learn the stuff that I am required to know.  Wink

I like to write database queries in the controller. I believe in following DRY. Don't Repeat Yourself. So I don't see the point of moving the database queries to the model if the code for the queries are only going to be used once in the code. It's not like I'm using the same block of code repeatedly.

Thank you for your help.
Reply


Messages In This Thread
RE: How do I have a global array in __construct() ? - by desbest - 08-07-2017, 01:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB