Reply to Referencing different static members in

Your name:

Reply:


Posted by Andr� Pletschette on 03/14/05 20:11

Hi,

In the static function "toHtml_table_heading" I want to use a static
array $fields, which is defined differently in each implementation.

My first trial was to use self::$fields[] to access this array, but
this only sees the member of DBTable, not the inherited from DBTable.

My second trial was to pass the classnmae thru $classname and to access
the correct $fields with $classname::$fields, but that doesn't seem to work.



abstract class DBTable {
static protected $fields = array();
static function toHtml_table_heading($classname) {
$fields = $classname::$fields; // <== syntax error, unexpected
T_PAAMAYIM_NEKUDOTAYIM
//...
}
//...
}

class DBImplementation extends DBTable {
public function intializeClass() {
self::$fields[] = new Object(1);
self::$fields[] = new Object(2);
}
function __construct() {
intializeClass()
}
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация