J'ai un souci avec la classe suivante:
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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40class Stack extends CheckForm { public $stackMsg = array(); public $cntStack = 0 ; function __construct() { $this->emptyStack() ; } function __destruct() {} // ================================== // All Error Stacking functions // ================================== public function getCntStack() 557 ==> { return($this->cntStack) ; } public function getStackError() // Public car function appelée fu formulaire... { user_error("getStackError[".$this->getCntStack()."]" , E_USER_NOTICE) ; $str = "" ; print("getStackError ==>[".$this->getCntStack()."]") ; // print_r($this->stackMsg); for ($i = 0 ; $i < $this->getCntStack() ; $i++) $str .= $this->stackMsg[$i] ; return($str) ; } public function stackMessage($msg) { $this->stackMsg[] = $msg . "<br>\n" ; $this->cntStack++ ; user_error("+++++++ Stacking msg[".$this->getCntStack()."][".$msg."]" , E_USER_NOTICE) ; print("Stacking[".$msg."] - cntStack[".$this->getCntStack()."]") ; // print_r($this->stackMsg); } public function emptyStack() { $this->cntStack = 0 ; user_error("emptyStack[".$this->getCntStack()."]" , E_USER_NOTICE) ; $this->stackMsg = array() ; } }
Le log PHP me dit que:
Je ne comprends pas, +/- à chaque occurence de $cntStack, le même message est affiché par PHP.....
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
17
18 [27-May-2010 18:24:18] PHP Notice: Start Validating field[0] cntStack[0] in F:\WebSites\test\checkform.php on line 651 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: Validate[prenom]-[]-[3]-[30] cntStack[] in F:\WebSites\test\checkform.php on line 452 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: ====> Validating.... cntStack[] in F:\WebSites\test\checkform.php on line 453 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: ====> Filled cntStack[] in F:\WebSites\test\checkform.php on line 431 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: ====> end of this validation[prenom].... cntStack[] in F:\WebSites\test\checkform.php on line 462 [27-May-2010 18:24:18] PHP Notice: End Validating field[0] cntStack[0] in F:\WebSites\test\checkform.php on line 654 [27-May-2010 18:24:18] PHP Notice: Start Validating field[1] cntStack[0] in F:\WebSites\test\checkform.php on line 651 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: Validate[nom]-[]-[3]-[30] cntStack[] in F:\WebSites\test\checkform.php on line 452 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: ====> Validating.... cntStack[] in F:\WebSites\test\checkform.php on line 453 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557 [27-May-2010 18:24:18] PHP Notice: ====> Filled cntStack[] in F:\WebSites\test\checkform.php on line 431 [27-May-2010 18:24:18] PHP Notice: Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
En fait après autres tests, il apparait que c'est chaque occurence de getCntStack que ce message apparait !
Question: pkoi test;;$cntStack et pas Stack::$cntStack qui est la classe propriétaire...... bien que j'ai une classe Text aussi qui appelle getCntStack..... poser la question s'est y répondre ?
Qui pourra me dire ? Merci à lui![]()







Répondre avec citation




Partager