I find when coding, if you close every tag (like you're supposed to) your PHP and HTML can be all nicely formatted together, with tabs opening and closing where they should. Start at the left, end at the left. Although I think I read somewhere that I'm supposed to use four spaces instead of tabs.
Pet peeve about proper indenting of HTML
Moderator: General Moderators
I'm format specific myself.
I find when coding, if you close every tag (like you're supposed to) your PHP and HTML can be all nicely formatted together, with tabs opening and closing where they should. Start at the left, end at the left. Although I think I read somewhere that I'm supposed to use four spaces instead of tabs.
Ah well.
I find when coding, if you close every tag (like you're supposed to) your PHP and HTML can be all nicely formatted together, with tabs opening and closing where they should. Start at the left, end at the left. Although I think I read somewhere that I'm supposed to use four spaces instead of tabs.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Roja has given me the what for!Roja wrote:You have a habit of making assumptions about the habits of others, and it would help to consider that lately, each time you do, I've had to speak up to tell you that I'm the opposite.
A little (Freudian) slip here, I think you meant, "where the syntax is incorrect."Roja wrote:Personally, I try to keep my html well formatted so that I can easily spot where the indenting is incorrect.
I agree to an extent. For me, reasonable vertical formatting of HTML gives me enough information to help spot problems -- I just don't find that indenting adds much for me given the effort to maintain the indenting. Also since I use hierarchical templates, the blocks get inserted whereever and maintaining correct indent level between disjoint HTML is simply too much work (and impossible when a block can be inserted in multiple places that have different levels of indenting).Roja wrote:It has helped me solve more html problems than using the validator
(#10850)
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Indenting code to match the indenting level if it's output!?!?Ambush Commander wrote:The other, function echo stuff, is a sad attempt at a Transform View without XSLT.
Code: Select all
function runReporter(&$reporter) { $reporter->paintHeader('Edit Wikipedia\'s Status'); $reporter->paintEditFormStart(); $reporter->paintImportantServicesField($this->important_services); $reporter->paintLesserServicesField($this->lesser_services); $reporter->paintSymptomGroupsField($this->symptomgroups); $reporter->paintCommentField($this->username); $reporter->paintSubmitButton(); $reporter->paintEditFormEnd(); $reporter->paintFooter(); }
Last edited by Christopher on Fri Apr 14, 2006 6:38 pm, edited 2 times in total.
(#10850)
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I would do vertical separation instead:
Code: Select all
function runReporter(&$reporter) {
$reporter->paintHeader('Edit Wikipedia\'s Status');
$reporter->paintEditFormStart();
$reporter->paintImportantServicesField($this->important_services);
$reporter->paintLesserServicesField($this->lesser_services);
$reporter->paintSymptomGroupsField($this->symptomgroups);
$reporter->paintCommentField($this->username);
$reporter->paintSubmitButton();
$reporter->paintEditFormEnd();
$reporter->paintFooter();
}(#10850)