Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

RC1: output filter

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
mplx
Smarty n00b


Joined: 13 Jun 2010
Posts: 3

PostPosted: Sun Jun 13, 2010 2:11 pm    Post subject: RC1: output filter Reply with quote

Hi,

I've upgraded a project to Smarty3 and it seems to work quite well, however I didn't manage to migrate the output filters.

While
Code:
load_filter('output','trimwhitespace');
works well (ok, it throws a Notice: function call 'load_filter' is unknown or deprecated. but I've disabled them as workaround with setDeprecationNotices(false) ) a
Code:
register->outputFilter('trimwhitespace');
throws a fatal php error (Fatal error: Call to undefined function trimwhitespace()).

First I thought this is a problem with my own filters, but the trimwhitespace is part of Smarty. Everything else works fine, so I guess the plugins dir is ok (and it works with load_filter).

So what's the thing I'm doing wrong?

Thanks for your help!
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Jun 13, 2010 3:30 pm    Post subject: Reply with quote

The API of Smarty3 has been changed. See the README.

$smarty->load_filter('output','trimwhitespace');

Is now

$smarty->loadFilter('output','trimwhitespace');

$smarty->register->outputFilter(...) must be used if a PHP function which is defined in your script shall be used as output filter.
Back to top
View user's profile Send private message
mplx
Smarty n00b


Joined: 13 Jun 2010
Posts: 3

PostPosted: Mon Jun 14, 2010 8:28 am    Post subject: Reply with quote

I knew I was doing something wrong, but sometimes you don't see the wood for the trees. Thanks! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP