Alexey Kosov
Alexey Kosov

Reputation: 3138

PhpStorm: How to separate PHP & HTML indentation

Is it possible to configure PhpStorm 8 to indent HTML and PHP code separately?

I'll copy the examples from this question: How to properly indent PHP/HTML mixed code?

How PhpStorm formats the code currently:

<table>
  <?php foreach ($rows as $row): ?>
    <tr>
      <?php if ($row->foo()): ?>
        <?php echo $row ?>
      <?php else: ?>
        Something else
      <?php endif ?>
    </tr>
  <?php endforeach ?>
</table>

How I want it to look like:

<table>
<?php foreach ($rows as $row): ?>
  <tr>
  <?php if ($row->foo()): ?>
    <?php echo $row ?>
  <?php else: ?>
    Something else
  <?php endif ?>
  </tr>
<?php endforeach ?>
</table>

Upvotes: 2

Views: 690

Answers (1)

lena
lena

Reputation: 93868

No, not currently possible. See this comment

Upvotes: 1

Related Questions