summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php b/lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php
index 04a901a..2972f3c 100644
--- a/lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php
+++ b/lib/smarty3/sysplugins/smarty_internal_method_setautoloadfilters.php
@@ -31,25 +31,27 @@ class Smarty_Internal_Method_SetAutoloadFilters
* @api Smarty::setAutoloadFilters()
*
* @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
- * @param array $filters filters to load automatically
- * @param string $type "pre", "output", … specify the
- * filter type to set. Defaults to
- * none treating $filters' keys as
- * the appropriate types
+ * @param array $filters filters to load automatically
+ * @param string $type "pre", "output", … specify
+ * the filter type to set.
+ * Defaults to none treating
+ * $filters' keys as the
+ * appropriate types
*
* @return \Smarty|\Smarty_Internal_Template
+ * @throws \SmartyException
*/
public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
{
- $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
+ $smarty = $obj->_getSmartyObj();
if ($type !== null) {
$this->_checkFilterType($type);
- $smarty->autoload_filters[ $type ] = (array) $filters;
+ $smarty->autoload_filters[ $type ] = (array)$filters;
} else {
- foreach ((array) $filters as $type => $value) {
+ foreach ((array)$filters as $type => $value) {
$this->_checkFilterType($type);
}
- $smarty->autoload_filters = (array) $filters;
+ $smarty->autoload_filters = (array)$filters;
}
return $obj;
}
@@ -64,7 +66,7 @@ class Smarty_Internal_Method_SetAutoloadFilters
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
+}