2

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>
Community
  • 1
  • 1
Alexey Kosov
  • 2,853
  • 2
  • 19
  • 31

1 Answers1

1

No, not currently possible. See this comment

lena
  • 80,392
  • 7
  • 128
  • 137