2

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

2 Answers 2

1

Have you tried using?

<tr bgcolor="<?= "red" ?>">
answered Mar 14, 2011 at 20:45
Sign up to request clarification or add additional context in comments.

3 Comments

No way! It worked. Thank you so much! I've never seen that syntax before. I'm assuming it's supposed to be inline?
Oh, wait I see. <?= means <?php echo
Changing your writing syntax because your formatter isn't working correctly isn't the way to go.
0

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

1 Comment

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! ;)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.