FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Loading globals into classes
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Loading globals into classes [message #176760 is a reply to message #176759] Sun, 22 January 2012 20:09 Go to previous messageGo to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: list() Struktur auslagern
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 23:23:38 GMT 2024

Total time taken to generate the page: 0.05656 seconds