Using the alternate syntax for control structures[1] when mixing PHP and
HTML template-style is the de facto standard I've seen, and it is the de
jure standard when dealing with Drupal PHP templates. Although we
structure it slightly differently:
<?php if ($blah): ?>
<div><?php echo $blah; ?>
<?php endif; ?>
That way it's more compact and the control structures read more like tags.
That's assuming you're in a template-esque file. If you're in a
non-template-esque file, you shouldn't be breaking out to HTML in the
first place. If you need to format a large block of HTML while in a
mostly-PHP file, use HEREDOC[2] instead.
[1]
http://php.net/manual/en/control-structures.alternative-syntax.php
[2]
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
--Larry Garfield
On 1/24/13 5:55 AM, Joubert Guimar�es de Assis wrote:
> There is a standard for opening and closing of loops when the source
> code is mixed with html?
>
> I see this so much I put the link
http://pastebin.com/Ls4VPGzN
> But if the html code for many lines in the middle, at the end you do not
> know if the keys that correspond repeating structure
>
>
> Thinking about this, I imagine it would be better this way
>
http://pastebin.com/MGasqgX1
> because then you know that at this point ending the repeating structure
>
>
> This way I implement this correct? Iwould like to discuss more about it.
>
> ps: sorry my bad english
>
> --
>
>