Add register/unregister API for output filters.

This commit is contained in:
andrei
2002-04-16 20:06:31 +00:00
parent ad0ef5a6e0
commit bfbefa484f
2 changed files with 44 additions and 16 deletions

View File

@@ -380,10 +380,7 @@ class Smarty
\*======================================================================*/
function unregister_prefilter($function)
{
if (isset($this->_plugins['prefilter'][$function]))
unset($this->_plugins['prefilter'][$function]);
else
$this->_plugins['prefilter'][$function] = false;
}
/*======================================================================*\
@@ -403,10 +400,27 @@ class Smarty
\*======================================================================*/
function unregister_postfilter($function)
{
if (isset($this->_plugins['postfilter'][$function]))
unset($this->_plugins['postfilter'][$function]);
else
$this->_plugins['postfilter'][$function] = false;
}
/*======================================================================*\
Function: register_outputfilter
Purpose: Registers an output filter function to apply
to a template output
\*======================================================================*/
function register_outputfilter($function)
{
$this->_plugins['postfilter'][$function]
= array($function, null, null, false);
}
/*======================================================================*\
Function: unregister_outputfilter
Purpose: Unregisters an outputfilter function
\*======================================================================*/
function unregister_outputfilter($function)
{
unset($this->_plugins['outputfilter'][$function]);
}
/*======================================================================*\

View File

@@ -380,10 +380,7 @@ class Smarty
\*======================================================================*/
function unregister_prefilter($function)
{
if (isset($this->_plugins['prefilter'][$function]))
unset($this->_plugins['prefilter'][$function]);
else
$this->_plugins['prefilter'][$function] = false;
}
/*======================================================================*\
@@ -403,10 +400,27 @@ class Smarty
\*======================================================================*/
function unregister_postfilter($function)
{
if (isset($this->_plugins['postfilter'][$function]))
unset($this->_plugins['postfilter'][$function]);
else
$this->_plugins['postfilter'][$function] = false;
}
/*======================================================================*\
Function: register_outputfilter
Purpose: Registers an output filter function to apply
to a template output
\*======================================================================*/
function register_outputfilter($function)
{
$this->_plugins['postfilter'][$function]
= array($function, null, null, false);
}
/*======================================================================*\
Function: unregister_outputfilter
Purpose: Unregisters an outputfilter function
\*======================================================================*/
function unregister_outputfilter($function)
{
unset($this->_plugins['outputfilter'][$function]);
}
/*======================================================================*\