Re: Auto-generating HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 20, 2010 at 4:52 PM, Andy McKenzie <amckenzie4@xxxxxxxxx> wrote:
> Here's a related question maybe one of you can answer:  is there any
> place in HTML (not PHP, but actually in HTML) where there's a
> difference between a single quote and a double quote?  As nearly as I
> can tell, it shouldn't ever matter.  If that's the case, using
> double-quotes to enclose an echo gets a lot simpler...
>
> -Alex
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The standard suggests that double quotes are to be used for HTML
attributes. It might be easier to use single quotes to wrap the whole
set and therefore allow the user of double quotes in your output.

My personal preference in what you are talking about is to have a view
function that takes an array of data and perhaps errors and then shows
the form with no other processing than maybe a loop. That way I can
create the HTML as I please, copy and paste it into the function, and
then do what ever I need to, to process the data before turning that
into an array and passing it into the function

function showForm($data, $errors){
?>
Name: <input type="text" value="<?php echo $data['name']; ?>" name="name">

<?php

}//end function

?>
-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux