Re: Retrieving values from array on a class

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

 



Hello,

I've rewritten my class as you told me:

----------------------------------------------------------
 class returnConfigParams

 {

  private static $instance = NULL;

  var $a;
  var $b;
  var $c;
  var $d;

  private function __construct() {
  }	

  // function that get the database parameters from "properties.php"

    public static function getInstance() {

    if (!self::$instance)
     {
    /*** set this to the correct path and add some error checking ***/
      include($_SERVER['DOCUMENT_ROOT']."/properties.php");
      self::$instance = array($a, $b, $c, $d);
   }
   return self::$instance;
 }
	
 private function __clone(){
 }	

}
----------------------------------------------------------

and i'm calling it with

returnConfigParams::getInstance(); (probably wrongly)

The question is how to access the individual elements of the array.

Can someone help me please ?

Cheers,
AR

-- 
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