Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4571

Re: Loading globals into classes

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Loading globals into classes
Date Sun, 22 Jan 2012 21:09:51 +0100
Lines 16
Message-ID <9o38ofFagkU1@mid.individual.net> (permalink)
References <jfhghn$rrn$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net mp7EXslg3SWYP1K6V3TBMwMQgXT9zszeOS2oKQrNpHhmCXtMHV
Cancel-Lock sha1:ybyUO7VdRkF71FJDDX8dko9KRbo=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20111226 Firefox/9.0.1 SeaMonkey/2.6.1
In-Reply-To <jfhghn$rrn$1@dont-email.me>
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:4571

Show key headers only | View raw


Scott Johnson wrote:

> public function __construct($uom_ary, $months_ary)
> {
> $this->uom_ary = $uom_ary;
> $this->months_ary = $months_ary;
> }
>
> Previously I just used the global at the top of each method but had to add it
> for each method needing the array.

Why not supply the information as arguments for the constructor.

-- 

   //Aho

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 09:20 -0800
  Re: Loading globals into classes "J.O. Aho" <user@example.net> - 2012-01-22 21:09 +0100
    Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 14:08 -0800
    Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 14:29 -0800
      Re: Loading globals into classes "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-23 00:32 +0100
        Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 17:10 -0800

csiph-web