Re: [SMARTY] Re: need modifier to break up paragraphs

From: Date: Sat, 30 Nov 2002 06:55:25 +0000
Subject: Re: [SMARTY] Re: need modifier to break up paragraphs
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6604@lists.php.net to get a copy of this message
On Fri, Nov 29, 2002 at 05:08:08PM -0500, Jeff Dickens wrote: > Thanks.. this works fine, but I noticed that the "nl2br" modifier is not > listed in the Smarty docs, nor can I find it when I grep the source. Is > there some "pass through" of php functions to Smarty that I am missing ? > > BTW, what is "Save-Mode" .. I can't find that in the docs either. this is a restricted mode, you can run you php scripts in. i cannot explain it better than http://www.php.net/manual/en/features.safe-mode.php have fun messju > -----Original Message----- > From: André Rabold [mailto:arabold@nero.com] > Sent: Thursday, November 28, 2002 3:32 AM > To: smarty-general@lists.php.net > Subject: [SMARTY] Re: need modifier to break up paragraphs > > > > {$text|@nl2br} > > should work if you don't use Smarty's Save-Mode. > > Have fun, > André > > > "Jeff Dickens" <dickens@dreamgear.com> schrieb im Newsbeitrag > news:CCELIEJMKMNBHIPNDJPNMEJNCEAA.dickens@dreamgear.com... > > Greetings.. I've been reading this list for a few days and have been > working > > with Smarty for a week or so. And now I have a question. > > > > I find myself doing this in php: > > > > $search = "\n"; > > $replace = "<br />"; > > $smarty->assign("text",str_replace($search, $replace, $text)); > > > > It seems to me this might be better done by a modifier in Smarty. > > > > In my application (a single-purpose CMS) text is entered in a form and > > stored in a database. When the text is retrieved for display, I want it > to > > be displayed with the original line breaks, so I replace all the newlines > > with "<br />". > > > > Anyone have a plugin to do this ? If not I'm going to try my hand at > > writing one. > > > > The usefulness of the new textformat function escapes me, unless you're > > going to put it inside of a <pre>. What I need is something like > textformat > > that outputs html. > > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#6604) next »