[PEAR][HTML_QuickForm] Instanciation dans une classe
Bonjour,
soit le code suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
class bObjList {
//Members
public $_list_of_bObj = array();
private $qf;
function __construct() {
$qf = new HTML_QuickForm();
array_push($this->_list_of_bObj, $this->qf->addElement('select'));
}
// Methods
public function addItem() {
// global $qf;
// array_push($this->_list_of_bObj, $this->qf->addElement('select'));
}
} |
Une erreur fatale est générée:
Code:
1 2
|
Fatal error: Call to a member function addElement() on a non-object in... |
Je ne vois pas d'où vient le problème, est ce qu'il est impossible d'instancier à l'intérieure d'une classe? Ou est ce-ce un problème lié a QuickForm?