Saturday, July 25, 2009

Re: Forcing new lines in a view.

I had the same problem with lines like :

<?php echo $html->charset() ?>

Because if PHP finds a carriage return after the closing tag it will
remove it. To avoid this I always add a space at the end of such
lines. PHP won't strip the space, then the \n is saved!

maybe it's not the cleanest way, but it's easy and won't add any code.


Martin

On 25 juil, 10:55, Shaun <sbef...@gmail.com> wrote:
> I'm using HTML helpers like $html->charset() and $html->meta() on
> separate lines, but of course the output is printed all on one line,
> which is very long and requires me to scroll horizontally when viewing
> the HTML source code.  I would like to tidy this up a bit and force a
> newline after each of my helper statements.  What's the best way to do
> this?  Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: