|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Karel S. Smarty Rookie
Joined: 03 Aug 2009 Posts: 26 Location: The Netherlands
|
Posted: Tue Sep 01, 2009 10:55 am Post subject: smarty_modifier_nl2br |
|
|
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 |
|
yankee Smarty Rookie
Joined: 02 Mar 2009 Posts: 31
|
Posted: Tue Sep 01, 2009 6:50 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Sep 01, 2009 9:25 pm Post subject: |
|
|
We decided to drop the nl2br modifier plugin and let it fallthrough directly to the PHP function. |
|
Back to top |
|
Karel S. Smarty Rookie
Joined: 03 Aug 2009 Posts: 26 Location: The Netherlands
|
Posted: Wed Sep 02, 2009 6:57 am Post subject: |
|
|
That is also a solution |
|
Back to top |
|
|
|
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
|