[FX.php List] PHP Question
Bob Patin
bob at patin.com
Thu Jul 20 17:12:51 MDT 2006
> Hmm...
Food for thought; the only thing I do know is that, when viewing a
page in Dreamweaver, it's easier to see the spots of PHP code
embedded in the HTML, because Dreamweaver shows the PHP code (in
design view) as a little icon. So Kevin, perhaps you're right that
it's easier to keep HTML separate and not use the ECHO command to
insert HTML unless absolutely necessary...
It's always really enlightening to see an alternate way of doing
something... leads to new ways of doing things and clearer ideas.
That's what I like about this particular list; there are some really
smart PHP guys here...
Bob
>> I don't know why I never thought to use ECHO rather than to move
>> in and out of PHP code... !
>>
>> This is much more elegant; I'll definitely store this away for
>> future use...
>>
>>
> That’s an interesting comment Bob. I tend to go the other way – I
> try as hard as I can to separate data processing logic from both
> structural and presentational layers. I’ll put all parsing logic at
> the top of a page, above any HTML code, and try to only drop into
> PHP when I need to print db data or other logic-based tasks. For
> example, if I’m not using PHP to write any variables into an
> element on a page, then (unless I’m using a loop to write out a
> table) I won’t use PHP to do it.
>
> For my money...
>
> <table>
> <?php
> // code to write out table rows and cells
> ?>
> </table>
>
> ...is cleaner, more elegant and easier to read than needlessly
> getting PHP to write out HTML elements.
>
> --
> Kevin Futter
> Webmaster, St. Bernard's College
> http://www.sbc.melb.catholic.edu.au/
>
> ------------------------------------------
> This e-mail and any attachments may be confidential. You must not
> disclose or use the information in this e-mail if you are not the
> intended recipient. If you have received this e-mail in error,
> please notify us immediately and delete the e-mail and all copies.
> The College does not guarantee that this e-mail is virus or error
> free. The attached files are provided and may only be used on the
> basis that the user assumes all responsibility for any loss, damage
> or consequence resulting directly or indirectly from the use of the
> attached files, whether caused by the negligence of the sender or
> not. The content and opinions in this e-mail are not necessarily
> those of the College.
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060720/c9c11209/attachment-0001.html
More information about the FX.php_List
mailing list