RE: [PHP] 'Pure' php vs 'mixed' (html + php)
| From: | David Freeman | Date: | Mon, 03 Jun 2002 00:45:30 +0000 |
| Subject: | RE: [PHP] 'Pure' php vs 'mixed' (html + php) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100351@lists.php.net to get a copy of this message | ||
> I've noticed that many people on the list code in 'pure' php, i.e.
>
> <?
> print "<input type='text' name='fname'
> size='50'>";
>
> // etc
> ?>
Personally, it depends on what I'm doing. I find that excessive use of
<? And ?> in my code gets distracting so if I need a lot of php code I
will usually put the straight html into echo/print strings. If I'm
doing something that is predominantly html with only a few php variables
or some such then I'll do it mostly in html.
Often if there's just a php code block I'll move it into an include and
then just include it in normal html. This helps readability and lets me
separate some of the layout aspects from the code logic aspects.
In the end if it's valid it will work. My only real decision is based
on readability for my own purposes.
CYA, Dave