Re: [PHP] Couple of beginner questions
- From: ash@xxxxxxxxxxxxxxxxxxxx (Ashley Sheridan)
- Date: Sun, 11 Jan 2009 15:02:28 +0000
On Sun, 2009-01-11 at 09:46 -0500, tedd wrote:
At 1:49 PM +0000 1/11/09, Ashley Sheridan wrote:I'm not wanting ti nitpick, but what if there were several attributes
Unless it's something like this:
<?php
echo "<h1 class=\"$headerClass\">$whatever</h1>";
?>
Which is unlikely for a header tag, but I know this sort of format gets
used a lot by me and others, especially for setting alternate row styles
on tables (damn browsers and not supporting alternate rows!)
Ash
Ash:
Here's the alterative I would use:
<h1 class="<php echo($headerClass);?>"><php echo($whatever);?></h1>
Again, please forgive my use of echo().
The point being, wherever you want to insert a variable, then do it,
but leave html out of your code.
My "alternate row styles" solution is this:
http://webbytedd.com/b/color-rows/
Please note that no html is harmed in the making of this presentation. :-)
Cheers,
tedd
you needed to populate from the PHP? I just find it easier on my eyes to
include HTML in the PHP string that's being output, but I can see the
definite merits for echoing out single parts that would only get in the
way of the HTML.
Ash
www.ashleysheridan.co.uk
.
- Follow-Ups:
- Re: [PHP] Couple of beginner questions
- From: tedd
- Re: [PHP] Couple of beginner questions
- References:
- Couple of beginner questions
- From: "Gary"
- Re: [PHP] Couple of beginner questions
- From: tedd
- Re: [PHP] Couple of beginner questions
- From: "Gary"
- Re: [PHP] Couple of beginner questions
- From: tedd
- Re: [PHP] Couple of beginner questions
- From: Paul M Foster
- Re: [PHP] Couple of beginner questions
- From: tedd
- Re: [PHP] Couple of beginner questions
- From: Ashley Sheridan
- Re: [PHP] Couple of beginner questions
- From: tedd
- Couple of beginner questions
- Prev by Date: Re: [PHP] Couple of beginner questions
- Next by Date: Re: [PHP] Editing in a text area field
- Previous by thread: Re: [PHP] Couple of beginner questions
- Next by thread: Re: [PHP] Couple of beginner questions
- Index(es):
Relevant Pages
|