Document formatting

Hi,

I have a code in some.php file (template file with .php extension):

<div >
     <?=Yii::t('common', 'SomeKey'); ?>
</div>


After pressing Ctrl+Alt+L (reformat code) I get:

<div >
     <?=
     Yii::t('common', 'SomeKey')
     ; ?>
</div>


What is this? Why? o_O
This does not happen every time.

And the second question:

Is it possible to highlight background in PHP code in this situation?
I mean, that the background of <?=Yii::t('common', 'SomeKey'); ?> would be different than the rest of HTML code.

0
2 comments

Hi Maxim,

1) Cannot advise you on this -- your example worked fine for me (I did not had such weird results).

2) File | Settings | Editor | Colors & Fonts | PHP. Now assign some background color for "PHP Code" style. Please note this will affect all PHP files -- even those consisting of PHP code only (e.g. Yii framework classes).

0
Avatar
Maxim Omelianenko

> 1) Cannot advise you on this -- your example worked fine for me (I did not had such weird results).

Да, это практически всегда форматирует нормально, но иногда форматирует в такую кашу.
Я бы и не писал этого, если бы оно всегда форматировало как обычно :) (тут можно по-русски?)

> 2) File | Settings | Editor | Colors & Fonts | PHP

Спасибо. Вроде то, что надо :)

0

Please sign in to leave a comment.