0

Is it possible to specify code style settings for inline PHP or PHTML files?

Hello,

I've tried to look in the forum for a similar question but no luck so far.

I'm looking for a way to specify code style (indentation, new line policy, etc) settings for PHTML files or HTML with inline PHP code.

Let's say I have the following piece of code:

<?php if ($this->canEmailToFriend()): ?>
            <p >
        <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a>
            </p>
          <?php endif; ?>`



If I use PHPStorms "Reformat Code" option on the whole file, the text gets reformatted to this:

  <?php if ($this->canEmailToFriend()): ?> <p >   <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a> </p>   <?php endif; ?>



Is there a way to change how PHPStorm applies code style settings on files with inline PHP code?


Thank you.

2 comments

Please sign in to leave a comment.