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

smarty_modifier_nl2br

 
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
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Tue Sep 01, 2009 10:55 am    Post subject: smarty_modifier_nl2br Reply with quote

Is it possible to modify the nl2br plugin and add its second parameter? From the manual:

string nl2br ( string $string [, bool $is_xhtml = true ] )

Default is xhtml, but not everyone is using that.

Code:

function smarty_modifier_nl2br($string, $is_xhtml = true)
{
    return nl2br($string, $is_xhtml);
}
Back to top
View user's profile Send private message
yankee
Smarty Rookie


Joined: 02 Mar 2009
Posts: 31

PostPosted: Tue Sep 01, 2009 6:50 pm    Post subject: Reply with quote

Well this feature has been introduced in php 5.3, so it's quite new. There is probably no other reason why you cannot use it by default.
On the other hand <br /> will work just as well with html.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Tue Sep 01, 2009 9:25 pm    Post subject: Reply with quote

We decided to drop the nl2br modifier plugin and let it fallthrough directly to the PHP function.
Back to top
View user's profile Send private message
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Wed Sep 02, 2009 6:57 am    Post subject: Reply with quote

That is also a solution 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