2 /** @package verysimple::Phreeze */
5 * import supporting libraries
7 require_once ("IObserver.php");
10 * ObserverToBrowser is an implementation of IObserver that outputs all
11 * messages to the smarty debug console
13 * @package verysimple::Phreeze
14 * @author VerySimple Inc.
15 * @copyright 1997-2005 VerySimple, Inc.
16 * @license http://www.gnu.org/licenses/lgpl.html LGPL
19 class ObserveToSmarty
implements IObserver
{
20 private $_smarty = null;
21 private $_counter = 0;
22 public function __construct($smarty) {
23 $this->_smarty
= $smarty;
24 $this->_smarty
->debugging
= true;
26 public function Observe($obj, $ltype = OBSERVE_INFO
) {
27 if (is_object ( $obj ) ||
is_array ( $obj )) {
28 $msg = "<pre>" . print_r ( $obj, 1 ) . "</pre>";
41 $msg = $desc . " " . $msg;
54 $this->_smarty
->assign ( str_pad ( $this->_counter ++
, 3, "0", STR_PAD_LEFT
) . "_" . $desc, $msg );