Still problems registering plugins
| From: | Matthias Mohr | Date: | Thu, 13 Feb 2003 11:00:17 +0000 |
| Subject: | Still problems registering plugins | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-7718@lists.php.net to get a copy of this message | ||
I have still problems when trying to register my plugins.
Now I wrote one PHP-file with normal functions which
I register inside my class which extends the Smarty-class.
Like this:
-----------------------------------------------------------------------------
function smarty_block_comment( $params, $content, &$this ) {
if ( $content === null )
return( true );
echo "";
return true;
}
class MySmarty extends Smarty {
function MySmarty() {
parent::Smarty();
parent::Smarty();
$this->plugins_dir[] = "/myplugins";
$this->left_delimiter = "<{";
$this->right_delimiter = "}>";
$this->register_block( "comment", "smarty_block_comment" );
}
}
-----------------------------------------------------------------------------
It still gives an error:
"[plugin] unknown tag - 'comment' (Smarty.class.php, line 2472)"
when trying to use the tag.
Is this a bug (I'm using Smarty v2.4.2) or what's wrong with my code?
BTW, if I put the function smarty_block_comment in a separate file
"block.comment.php" inside the myplugins-directory and remove
the line with "$this->register_block" it works.
but I wanted to put all my application specific plugins in one file...
with regards,
Matthias