I want to upgrade to Zend Studio (currently using Netbeans), but I am slightly disappointed about how the formatter formats PHP in HTML attributes. Given this:
<tr bgcolor="<?php echo "red"; ?>">
Zend Studio will format it similar to this:
<tr bgcolor="<?php
echo "red";
?>">
Has anyone been able to change this behavior? Thank you,
Deduplicator
46k7 gold badges73 silver badges125 bronze badges
asked Mar 14, 2011 at 20:25
Chris Laplante
29.7k18 gold badges109 silver badges137 bronze badges
2 Answers 2
Have you tried using?
<tr bgcolor="<?= "red" ?>">
answered Mar 14, 2011 at 20:45
xordon
5,6614 gold badges20 silver badges26 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
Chris Laplante
No way! It worked. Thank you so much! I've never seen that syntax before. I'm assuming it's supposed to be inline?
Chris Laplante
Oh, wait I see.
<?= means <?php echoZar
Changing your writing syntax because your formatter isn't working correctly isn't the way to go.
Few comments about the pros and cons of short tags here: PHP echo vs PHP short tags
Slightly off topic but I recommend you use CSS not bgcolour for your colours etc.
answered Mar 15, 2011 at 17:12
Ric
3,5081 gold badge36 silver badges52 bronze badges
1 Comment
Chris Laplante
Thanks for the link! I do use CSS, but I was feeling lazy so I ripped that snippet from the example project that comes with Zend Studio... so shame on them! ;)
Explore related questions
See similar questions with these tags.
default