From: lbergman <lbe...@ab...> - 2001-05-02 15:41:10
|
> echo " <a > href=\"blah.php?var1=$var1&var2=$var2&var3=$var3\">$link</a>\n"; > or > echo ' <a > href="blah.php?var1='.$var1.'&var2='.$var2.'&var3='.$var3.'">'.$link.'</ > a>'."\n"; > > I've seen it both ways in several files, though I think I'd prefer the > second. > The reason that was started was cleanliness and speed. Clean because less escaping is needed and speed because nothing is evaluated inside single qoutes. With those two in mind it is difficult to set a hard and fast rule on when it becomes "cleaner and faster" to go with double qoutes and when it is such to use single. Obviously if you are not evaluating anything single qoutes rule. Or, if only one var in a long HTML string. After that it gets gregarious trying to impliment a standard that seems to make sense when you are coding. > --ITEM B-- > In the same vein, most of the strings in the files I've dealt with to > this point have gone something like this: > > echo ' </TD>'; > echo ' </TR>'; > echo ' <TR>'; > echo ' <TD ALIGN="left">'."\n"; // out of the blue > > Shouldn't this be more like this: > > echo ' </TD>'."\n"; > echo ' </TR>'."\n"; > echo ' <TR>'."\n"; > echo ' <TD ALIGN="left">'."\n"; // consistancy > I would haave to see what the resulting HTML looked like. I sometimes do that kind of thing to combine tags on a single line to make it more logically broken down. But, that would seem to imply a newline after the first </TR> and not where it is shown. > > --ITEM C-- > Finally, is there an HTML style guide or something similar (ie, > http://bcr.org/stylemanual/coding.html) to go by for the HTML that we > output? I'm more than willing to draft one if there's not, but I didn't > really see anything like this regarding the HTML output in the WIKI or > the docs. Luke came up with something but I don't know where he put it. Maybe in that purposal thing in cvs. It had things like 80 columns in coding, all lower case tags, things like that. A coding doc would be very helpfull for all of us I think. -- Lewis Bergman Texas Communications 4309 Maple St. Abilene, TX 79602 915-695-6962 |