How can I unload or disallow smarty core plugins from a template when using $smarty->fetch('mytemplate.tpl') method
For example the template mytemplate.tpl contains {html_options} and {html_table}
When using $smarty->fetch('mytemplate.tpl') only the {html_options} should be parsed by smarty, but {html_table} not
removing the function.html_table.php from plugin folder is not an option as it is still in use by another $smarty->fetch() call
A possible solutions is to extend from the
Smarty_Securityclass and enable securty by using the method$smarty->enableSecurity($instanceOfClass)Once the fetch method has been called ,
disableSecuritymethod do the trick to reenable allplugins/tags/modifiersagain.Unfortunately when enableSecurity is used and forbidden functions are used an Exception is thrown
An alternative is to replace all tags/variables/... you want to disallow with {literal}{forbiddenTags}{/literal} by using
preg_replacebefore calling$smarty->fetch([...])Example
More details about the Security class here: http://www.smarty.net/docs/en/advanced.features.tpl