Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7991161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:13:04+00:00 2026-06-04T13:13:04+00:00

Im currently using codeigniter 2 with ci-Smarty. Just been trying to add a smarty

  • 0

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?

I am using a plugin as the output filter function and have the following code:

LOCATION: /libraries/Smarty.php

// Set email output filter
$this->loadFilter('output', 'protect_email');

LOCATION: /third_party/Smarty/plugins/function.protect_email.php

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;
}

The above seems to throw the following smarty error:

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

Sorry about it being so long! Just thought seeing the whole error may help.

Thanks a lot for reading and hope someone can help.

–>EDIT
Also just tried to explicitly set the plugins directory location using:

$this->setPluginsDir(config_item('plugin_directory'));

The echoed out the location which is correct but still get the same problem 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:13:05+00:00Added an answer on June 4, 2026 at 1:13 pm

    Okay that was a silly mistake.

    For anyone else who has the same problem I was just looking through and realised the plugin should not be referred to as a regular function. For example it should have been called:

    outputfilter.protect_email.php
    

    Also make the same amends with the function name as well so in my case it should be called:

    smarty_outputfilter_protect_email
    

    This worked great for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am using codeigniter 2.0.2 version. I have searched all files but not
Im currently using codeigniter to build a messaging system and im trying to stay
I'm implementing a search box using CodeIgniter, but I'm not sure about how I
I am currently using CodeIgniter. I am trying to write a function that can
Using codeigniter image lib is it possible to just change an image type? Trying
I've been rebuilding my site using CodeIgniter. I am currently making the sign up
I'm currently using Codeigniter as my default framework to create some my projects. But,
Currently I have create a website using codeigniter. I got a message error every
Currently using Google Analytics as a supplement to our paid tracking software, but neither
I am developing a website using Codeigniter and MongoDB (Alex Bilbie library). Currently there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.