Frage

Is there a way to prevent PHPStorm 6 adding spaces after <?= and before ?> in constructions like

<a href="<?=$variable?>">blah</a>

during Reformat Code (Ctrl+Alt+L) ?

Suddenly, it inserts spaces

<a href="<?= $variable ?>">blah</a>
            ^         ^
            |  here   |  

Googling and digging Settings dialog didn't help.

Thanks.

War es hilfreich?

Lösung

File->Settings->Editor->Code Style->PHP->Spaces->Within

Andere Tipps

Try using the trim function in PHP

http://php.net/manual/en/function.trim.php

By telling it to remove whitespace or something that could strip it down to its true value. I'm not too familiar with PHPStorm.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top