public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
    {
        $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
        if ($type !== null) {
            $this->_checkFilterType($type);
            $smarty->autoload_filters[$type] = (array) $filters;
        } else {
            foreach ((array) $filters as $type => $value) {
                $this->_checkFilterType($type);
            }
            $smarty->autoload_filters = (array) $filters;
        }
        return $obj;
    }