Skip to content

Instantly share code, notes, and snippets.

@mashiox
Created October 12, 2017 22:58
Show Gist options
  • Save mashiox/530c5b4fa27570c9c98bc9c4ae8b004a to your computer and use it in GitHub Desktop.
Save mashiox/530c5b4fa27570c9c98bc9c4ae8b004a to your computer and use it in GitHub Desktop.
Demonstrate tabulation practices in HTML-embedded PHP
<!-- CASE 1 -->
<div>
<?php if ($someCond): ?>
<!-- Standard indentation in body of IF -->
<p>
<a href="/">Go Home</a>
</p>
<?php endif; ?>
</div>
<!-- CASE 2 -->
<div>
<?php if ($someCond): ?>
<!-- Postponed indentation in body of IF -->
<p>
<!-- First child of first element in IF indented -->
<a href="/">Go Home</a>
</p>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment