Re: Issue Extending Smarty an using Output Filters
| From: | Mauricio Araya V. | Date: | Thu, 12 May 2005 15:42:26 +0000 |
| Subject: | Re: Issue Extending Smarty an using Output Filters | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12623@lists.php.net to get a copy of this message | ||
Hello there!
This is an auto-answer just to say that I found my error.
This is the fix:
class myClass extends Smarty {
....
public function beautifyCode ($code){
$beauty = new XML_Beautifier( );
$beautycode = $beauty->formatString($code);
if (is_object($beautycode)){
return $code;
}else{
return $beautycode;
}
}
...
public function publishContent ( ){
$this->register_outputfilter(array(&$this, "beautifyCode"));
$this->display($this->template_file);
}
...
}
The problem occurred just because of a mistake in the template. I
didn't close the "head" tag resulting in a malformed XML, so return
$beauty->formatString($code); was returning an object.
Thanks anyways,
-Mauricio