Re: One class, many methods: PHP4.x: Q's

From: Date: Thu, 10 May 2007 14:25:18 +0000
Subject: Re: One class, many methods: PHP4.x: Q's
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-254731@lists.php.net to get a copy of this message
Hi Rich! Thanks for the quick reply. I really appreciate your help. :) Richard Davey wrote:
In PHP 5 could you create $docroot as a protected class constant, but in PHP 4 the above will have to do.
Ahhh! Very interesting. Many thanks for the code example and explanation -- that approach works for me. I assume setting basic strings (i.e. "settings") for my error messages would be best done via: class Randimg { var $msg_1 = 'This is a string'; var $msg_2 = 'This is another string'; function rand_img() { echo $this->msg_1; } function foo() { echo $this->msg_2; } } It just seems so extraneous to declare those strings as vars... A class constant sounds like the best approach. I can't wait to start using PHP5! :D Thanks again Rich! I really appreciate your time and expertise. Have a great day and/or night. Cheers, Micky -- Wishlists: <http://snipurl.com/1gqpj> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse>

« previous php.general (#254731) next »