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
  • 3,010
  • 2
  • 23
  • 32

1 Answers1

1

No, not currently possible. See this comment

lena
  • 90,154
  • 11
  • 145
  • 150