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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux