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

From: Date: Fri, 29 Nov 2002 22:08:08 +0000
Subject: RE: [SMARTY] Re: need modifier to break up paragraphs
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6602@lists.php.net to get a copy of this message
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. -----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

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