Bonjour,
J'ai un pb dans une classe qui me génère une msg dans le log alors que pour moi, tous les intervenants sont PUBLIC !
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
| class Message Extends ErrorHandler
{ private $cntFilled, $cntField, $valid ;
public $msg, $tabMsg = array( VIDE => "Prêt à recevoir l'encodade de votre formulaire" ,
KO => "Veuillez corriger les fautes/complètez votre formulaire" ,
OK => "Parfait, pas(plus) d'erreur(s) dans ce formulaire"
) ;
function __construct($cntFilled, $cntField, $valid /* Boolean */)
{ $this->cntFilled = $cntFilled ;
$this->cntField = $cntField ;
$this->valid = $valid ;
//
// Error Handler
// =============
try {
if ($this->cntFilled == 0)
$this->msg = VIDE ;
elseif ($this->cntFilled < $this->cntField)
$this->msg = KO ;
elseif ($this->cntFilled == $this->cntField)
$this->msg = OK ;
else
throw new Exception("Count [field filled] greater than [total count form fields] !") ;
} catch (Exception $E)
{ ErrorHandler::exception_handler($E) ; }
}
function __destruct()
{ }
public function getMessage()
785 ==> { return( $this->tabMsg[$this->msg] ) ; }
} |
Et le log:
[29-May-2010 08:43:23] PHP Notice: Undefined property: Form::$tabMsg in F:\WebSites\test\checkform.php on line 78
Bizarre vous avez dit bizarre ....
Qui me dira..... merci @lui
Partager