Note that there are some explanatory texts on larger screens.

plurals
  1. POSmarty output filters with Codeigniter and Ci-Smarty "not callable" error
    primarykey
    data
    text
    <p>Im currently using codeigniter 2 with ci-Smarty. Just been trying to add a smarty output filter but not having much luck. Its as if the function cannot be found or something?</p> <p>I am using a plugin as the output filter function and have the following code:</p> <p><strong>LOCATION:</strong> /libraries/Smarty.php</p> <pre><code>// Set email output filter $this-&gt;loadFilter('output', 'protect_email'); </code></pre> <p><strong>LOCATION:</strong> /third_party/Smarty/plugins/function.protect_email.php</p> <pre><code>function smarty_function_protect_email($tpl_output, Smarty_Internal_Template $template) { $tpl_output = preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!', '$1%40$2', $tpl_output); return $tpl_output; } </code></pre> <p>The above seems to throw the following smarty error:</p> <blockquote> <p>Fatal error: Uncaught exception 'SmartyException' with message 'outputfilter "protect_email" not callable' in /home/something/public_html/application/third_party/Smarty/sysplugins/smarty_internal_templatebase.php:717 Stack trace: #0 /home/something/public_html/application/libraries/Smarty.php(46): Smarty_Internal_TemplateBase->loadFilter('output', 'protect_email') #1 /home/something/public_html/system/core/Loader.php(1095): CI_Smarty->__construct(Array) #2 /home/something/public_html/system/core/Loader.php(975): CI_Loader->_ci_init_class('Smarty', '', NULL, NULL) #3 /home/something/public_html/system/core/Loader.php(216): CI_Loader->_ci_load_class('smarty', NULL, NULL) #4 /home/something/public_html/application/libraries/MY_Parser.php(29): CI_Loader->library('smarty') #5 /home/something/public_html/system/core/Loader.php(1099): MY_Parser->__construct() #6 /home/something/public_html/system/core/Loader.php(938): CI_Loader->_ci_init_class('Parser', 'MY_', NULL, NULL) #7 /home/something/public_html/system/core/Loader.php(216): CI_Loa in /home/something/public_html/application/third_party/Smarty/sysplugins/smarty_internal_templatebase.php on line 717</p> </blockquote> <p>Sorry about it being so long! Just thought seeing the whole error may help.</p> <p>Thanks a lot for reading and hope someone can help.</p> <p>-->EDIT Also just tried to explicitly set the plugins directory location using:</p> <pre><code>$this-&gt;setPluginsDir(config_item('plugin_directory')); </code></pre> <p>The echoed out the location which is correct but still get the same problem :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload