Re: Ouput HTML w/PHP

From: Date: Thu, 30 Jun 2005 14:18:50 +0000
Subject: Re: Ouput HTML w/PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-217889@lists.php.net to get a copy of this message
Hi, It seems to me you are going the wrong way with "embedded" PHP; try separating logic from view, tons of mvc frameworks out there and templating engines. Try firefox with web developer extension -> Validate Local HTML. Catalin Rick Emery wrote: > And now for something completely different... > > I have a question that has been nagging at me. I've searched the > archives, FAQs, and web sites, but haven't found an answer. > > I have two ways that I've output HTML with PHP; one is to write the > HTML, using the PHP tags to execute code when necessary. The other is to > store the entire HTML output file in a string variable with > concatenation and call the print (or echo) function at the bottom to > output the page. > > Are there advantages one way or the other? > > This leads (sort of) to a second question: how can I validate my HTML? > My applications run on an intranet (with database access), so I can't > use the W3C Validator to point to the URL. If I try to upload the file, > the validator doesn't parse the PHP to get the HTML output (which is why > I wonder if I'm not better writing the HTML and sticking PHP where it's > needed). Is there a way for me to maybe use the PHP tidy functions on > the string containing the HTML ouput to validate it? > > Thanks in advance, > Rick

« previous php.general (#217889) next »