Page 2 of 2
Posted: Fri Apr 14, 2006 5:22 pm
by s.dot
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.
Posted: Fri Apr 14, 2006 5:25 pm
by Ambush Commander
Hmm... then I'm doing something incorrectly formatting wise. Can I see a piece of template code of yours that includes a conditional on an entire block element?
Posted: Fri Apr 14, 2006 5:26 pm
by Christopher
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.

Roja has given me the what for!
Roja wrote:Personally, I try to keep my html well formatted so that I can easily spot where the indenting is incorrect.
A little (Freudian) slip here, I think you meant, "where the
syntax is incorrect."
Roja wrote:It has helped me solve more html problems than using the validator
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).
Posted: Fri Apr 14, 2006 5:31 pm
by Christopher
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();
}
Indenting code to match the indenting level if it's output!?!?
Posted: Fri Apr 14, 2006 5:34 pm
by Ambush Commander

Yup. A lot easier to read, in my opinion, than a solid block of paints.
Posted: Fri Apr 14, 2006 6:38 pm
by Christopher
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();
}