Last active
December 28, 2015 05:39
-
-
Save tonijz/7451578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BAD | |
// Hard to read because of php syntax everywhere... If whole file will be written like this, | |
// It gonna take a lot of time for others to understand | |
<tr> | |
<td> | |
<?php if($c['status'] == "Live") { ?> | |
<span class="label label-success"> | |
<?php } else { ?> | |
<span class="label label-warning"> | |
<?php } ?> | |
<?php echo $c['status']; ?> | |
</span> | |
</td> | |
// BETTER | |
// In templates u should use alternative php syntax, there will be none of those anoying brackets {} | |
// looks much better IMO | |
<tr> | |
<td> | |
<?php if($c['status'] == 'Live'): ?> | |
<span class="label label-success"> | |
<?php else: ?> | |
<span class="label label-warning"> | |
<?php endif; ?> | |
<?php echo $c['status']; ?> | |
</span> | |
</td> | |
// PROPPER | |
// Takes just one line :) | |
// Easy to read | |
<tr> | |
<td> | |
<span class="label<?php echo ($c['status'] == 'Live') ? ' label-success' : ' label-warning' ; ?>"> | |
<?php echo $c['status']; ?> | |
</span> | |
</td> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment