How do I have a global array in __construct() ? |
(08-07-2017, 01:05 PM)desbest Wrote: 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 fact that you don't even know how to set a public variable inside a class to be accessible by related objects, indicates that you still doesn't know THE VERY BASIC of oop. or, that "good tutorial" you're using as learning resource doesn't provide a good basic practice of oop. or, you're the kind of person that likes to skim an article of tutorial, skipping important parts, and brags that "i already learned the article, and its good". writing queries inside controllers is... i asure you... a very-very bad practice. your so-called 'DRY' isn't just talking about repeating the same-exact things over and over. it's also a practice of how to better organize your source between app-logic and db-models in your app. so I'm gonna agree with everyone else here, STOP DOING WHAT YOU'RE DOING... and right now. |
Messages In This Thread |
How do I have a global array in __construct() ? - by desbest - 08-03-2017, 05:55 AM
RE: How do I have a global array in __construct() ? - by Martin7483 - 08-03-2017, 06:15 AM
RE: How do I have a global array in __construct() ? - by InsiteFX - 08-03-2017, 08:07 AM
RE: How do I have a global array in __construct() ? - by rtenny - 08-04-2017, 08:51 AM
RE: How do I have a global array in __construct() ? - by desbest - 08-07-2017, 01:05 PM
RE: How do I have a global array in __construct() ? - by jarmen_kell - 08-07-2017, 04:23 PM
|