Bonjour,
soit le code suivant:
Une erreur fatale est générée:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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')); } }
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?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Fatal error: Call to a member function addElement() on a non-object in...
Partager