summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php b/lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php
index 7c8a12a..c0f9fff 100644
--- a/lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php
+++ b/lib/smarty3/sysplugins/smarty_internal_method_registerfilter.php
@@ -33,20 +33,20 @@ class Smarty_Internal_Method_RegisterFilter
* @link http://www.smarty.net/docs/en/api.register.filter.tpl
*
* @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
- * @param string $type filter type
- * @param callback $callback
- * @param string|null $name optional filter name
+ * @param string $type filter type
+ * @param callback $callback
+ * @param string|null $name optional filter name
*
* @return \Smarty|\Smarty_Internal_Template
* @throws \SmartyException
*/
public function registerFilter(Smarty_Internal_TemplateBase $obj, $type, $callback, $name = null)
{
- $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
+ $smarty = $obj->_getSmartyObj();
$this->_checkFilterType($type);
$name = isset($name) ? $name : $this->_getFilterName($callback);
if (!is_callable($callback)) {
- throw new SmartyException("{$type}filter \"{$name}\" not callable");
+ throw new SmartyException("{$type}filter '{$name}' not callable");
}
$smarty->registered_filters[ $type ][ $name ] = $callback;
return $obj;
@@ -55,7 +55,7 @@ class Smarty_Internal_Method_RegisterFilter
/**
* Return internal filter name
*
- * @param callback $function_name
+ * @param callback $function_name
*
* @return string internal filter name
*/
@@ -63,7 +63,6 @@ class Smarty_Internal_Method_RegisterFilter
{
if (is_array($function_name)) {
$_class_name = (is_object($function_name[ 0 ]) ? get_class($function_name[ 0 ]) : $function_name[ 0 ]);
-
return $_class_name . '_' . $function_name[ 1 ];
} elseif (is_string($function_name)) {
return $function_name;
@@ -82,7 +81,7 @@ class Smarty_Internal_Method_RegisterFilter
public function _checkFilterType($type)
{
if (!isset($this->filterTypes[ $type ])) {
- throw new SmartyException("Illegal filter type \"{$type}\"");
+ throw new SmartyException("Illegal filter type '{$type}'");
}
}
-} \ No newline at end of file
+}