Hello zabassi, Thanks for that tip. But that still doesn't display the white-spaces like tabs, spaces (if any) in the text.
Thanks and Regards Vikram On Feb 20, 2:51 am, zabbasi <[email protected]> wrote: > Hi Vikram and Andy > > Can't we use something like this - > At the beginning: > <?php use_helper('Text') ?> > [....] > <?php echo simple_format_text($list->getBody()) ?> > > The simple_format_text() helper formats $list->getBody() as HTML, by > replacing carriage returns with <br />. As this helper belongs to the > Text helper group, which is not loaded by default, we have loaded it > manually by using the use_helper() helper. > > From documentation found on symfony > sitehttp://www.symfony-project.org/jobeet/1_2/Propel/en/04 > > Let me know if I mis-understood the problem. > > Thanks > Zain > > On Feb 19, 3:28 pm, SeeVik <[email protected]> wrote: > > > Oh no....but wait a moment.. What about whitespaces. How can I > > display the white-spaces as it is?? > > > ESC_RAW doesn't work for them. > > > Thanks and Regards > > Vikram > > > On Feb 19, 7:24 pm, SeeVik <[email protected]> wrote: > > > > Hello Andy, > > > > Thanks for the solution. Neat trick that is. :) > > > > Thanks and Regards > > > Vikram > > > > On Feb 19, 6:37 pm, "Andy Dziahel'" <[email protected]> wrote: > > > > > Hi. > > > > > Well, if you'll var_dump $list variable, you'll see that it's not an > > > > instance of List (or whatever) - it's instance of > > > > sfOutputEscaperObjectDecorator. So because of that, your > > > > $list->getBody()won't return > > > > '<br/>' - it'll return '*>*br/*<*'. To get unescaped value, you > > > > should > > > > call $list->getBody(ESC_RAW). > > > > > On Thu, Feb 19, 2009 at 11:24, SeeVik <[email protected]> > > > > wrote: > > > > > > Hello all, > > > > > > I walked into a strange problem. In my database I have stored data > > > > > which contains new-line feeds and I am unable to display them in view. > > > > > > I did something like this in my view... > > > > > <pre><?php echo preg_replace( '/\n/', '<br>', $list->getBody() ) ?></ > > > > > pre> > > > > > > What this did was to just display <br> as it is... I tried putting the > > > > > function inside some helper or a static class as well. That didn't > > > > > work either. > > > > > > However when I do like > > > > > <pre><?php echo 'abc<br123' ?></pre> > > > > > > It displays the strings on separate lines. > > > > > > How do we workaround this? > > > > > > Thanks and Regards > > > > > Vikram > > > > > -- > > > > With the best regards, Andy.- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
