Reply to Re: my HTML header - any feedback?

Your name:

Reply:


Posted by Toby A Inkster on 10/11/45 12:00

Mike Placentra II wrote:

> There's no advantage to processing in the middle of the output. It makes
> more sense not to separate your code into header and processing blocks.
> All processing should usually be done before any output so you don't end
> up with spaghetti code.

My general technique nowadays is not to distinguish so much between
processing and output. My PHP builds up a large object, representing the
page, and at the end, I just run:

print $page->toHTML;

or somesuch. Only one print statement for the entire PHP script, and no
HTML outside the <?php ... ?> block.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 23:00.]

Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatriciana/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация