Mailinglisten-Archive |
Hallo Hannes,
wenn ich das jetzt richtig verstanden habe, möchtest du nur Fehler
sammeln und dann geballt ausgeben?
file_name: class.msgbox.php
<?php
DEFINE( "MSG_INFO", "info" );
DEFINE( "MSG_WARN", "warn" );
DEFINE( "MSG_ERROR", "error" );
$msgbox = new MsgBox();
class MsgBox {
var $token = "<br />";
var $status = array(
MSG_INFO => FALSE,
MSG_WARN => FALSE,
MSG_ERROR => FALSE
);
var $text = array(
MSG_INFO => array(),
MSG_WARN => array(),
MSG_ERROR => array()
);
function set( $text, $type="info" ) {
$this->status[$type] = TRUE;
array_push( $this->text[$type], $text );
}
function get( $type ) {
return implode( $this->token, $this->text[$type] );
}
function check( $type ) {
return $this->status[$type];
}
}
?>
du kannst dann checken, ob ein Fehler etc. vorhanden ist, und ausgeben.
Grüsse
Christian
php::bar PHP Wiki - Listenarchive