General use class: static or not? |
(05-07-2020, 08:53 AM)YanKleber Wrote: I see... well I am not sweating too much about this... I tested and both methods work without any noticeable difference. I just was imagining if one of them couldĀ be considered more "correct". Thanks! Hi, if is CI4 make your class as service and you call directly like this: PHP Code: $class = \Config\Services::yourClass(); Here are docs: https://codeigniter4.github.io/userguide...vices.html |
Messages In This Thread |
General use class: static or not? - by YanKleber - 05-06-2020, 02:04 PM
RE: General use class: static or not? - by php_rocs - 05-06-2020, 02:28 PM
RE: General use class: static or not? - by YanKleber - 05-06-2020, 02:29 PM
RE: General use class: static or not? - by php_rocs - 05-06-2020, 02:53 PM
RE: General use class: static or not? - by YanKleber - 05-07-2020, 08:53 AM
RE: General use class: static or not? - by nicojmb - 05-07-2020, 03:05 PM
RE: General use class: static or not? - by YanKleber - 05-07-2020, 05:57 PM
RE: General use class: static or not? - by php_rocs - 05-07-2020, 11:41 PM
|