Bonjour,
J'ai un souci dans un script où j'ai plusieurs objects rassemblés dans un tableau et je fais (j'essaye) de faire la ventillation des traitements au mouyen de la fonction PGP: getclass....
Voici
plus loin je fais:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 $fields = array ( new String ( "prenom" , ON , aE , 3, 30 ) , new String ( "nom" , ON , aNumE , 3, 30 ) , new String ( "numero" , ON , aE , 1, 5 new String ( "boite" , OPT , aNum , 1, 5 ) , new String ( "pass" , ON , aNum , 6, 8 ) , new String ( "numero" , ON , aE , 1, 5 ) , new String ( "email" , ON , aE , 8, 30 ) , new String ( "Zip" , ON , aE , 5, 5 ) , ); $cf = new Form($fields);
et en 80, j'ai dans le log 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 for($i = 0 ; $i < $this->cntField ; $i++) { $this->object = $this->form[$i] ; $this->className = get_class($object); 80 => user_error("ClassName[".$this->className."]" , E_USER_NOTICE) ; switch($this->className) { case "String" : user_error("String" , E_USER_NOTICE) ; $this->object->Validate() ; if ( $this->object->Filled() ) $this->cntFilled++ ; break ; default : break ; } }
DOnc, j'ai le nom de la classe du tableau et nom de l'élément [$i] comme je le croyais.....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 [03-Sep-2010 11:06:05] PHP Notice: ClassName[Form] in F:\WebSites\checkform\validation\validate.php on line 80 [03-Sep-2010 11:06:05] PHP Notice: POST SUBMIT CATCHED in F:\WebSites\checkform\index.php on line 54
Me suis-je planté qlque part ?
Manque le $this->object........
Merci de me corriger....
Partager