comanage-dev - Re: [comanage-dev] endif vs braces
Subject: COmanage Developers List
List archive
- From: Benn Oshrin <>
- To:
- Subject: Re: [comanage-dev] endif vs braces
- Date: Mon, 02 Apr 2012 09:20:42 -0400
I think your suggestion sounds good. The minor addition I'd add would be to put a comment in the close tag to make it easier to track which tag goes with which. eg:
<?php if($foo): ?>
<?php if($bar): ?>
<?php endif; // bar ?>
<?php endif; // foo ?>
I'll add a section to the style guide.
On 3/30/12 7:51 PM, Marie Huynh wrote:
As far as I know, there is no functional difference between using this:
<?php if(){ ?>
stuff;
<?php } ?>
and this:
<?php if() : ?>
stuff;
<?php endif; ?>
Benn, have you given any thought to this or found any reason to go with
one or the other since we talked about it? I think it makes sense to
use the latter for parts of the view with lots of html that are much
cleaner with the controls split into different php tags, but unnecessary
if they are in the same <?php ?>. Does that sound like a good guideline?
Marie
- Re: [comanage-dev] endif vs braces, Benn Oshrin, 04/02/2012
- Re: [comanage-dev] endif vs braces, Marie Huynh, 04/03/2012
- Re: [comanage-dev] CO-80 diff, Benn Oshrin, 04/05/2012
- Message not available
- Message not available
- Re: [comanage-dev] CO-80 diff, Marie Huynh, 04/10/2012
- Re: [comanage-dev] CO-80 diff, Benn Oshrin, 04/13/2012
- Re: [comanage-dev] CO-80 diff, Marie Huynh, 04/10/2012
- Message not available
- Message not available
- Re: [comanage-dev] CO-80 diff, Benn Oshrin, 04/05/2012
- Re: [comanage-dev] endif vs braces, Marie Huynh, 04/03/2012
Archive powered by MHonArc 2.6.16.