php in html indent issue

Hi,

I have been testing phpstorm for a few days to see whether it fits my needs and I should purchase it. There is one thing that really bothers me at this moment:
1. I create a php file in the project
2. I copy the basic html layout to it
3. I begin writing php code into the body and here comes the problem: the code in php tags doesn't keep its identation.

I would expect something like this:
...
<body>
<?php
     $array1 = array("a" => "I am A", "b" => "I am B"); //I have to indent this manually

     echo print_r($array1); //I would assume it keeps the indent

?>
</body>
...

instead, the indent is resetted every time:
...

<body>
<?php
     $array1 = array("a" => "I am A", "b" => "I am B"); //I have to indent this manually

echo print_r($array1); //Hey, I want my indent here! It doesn't keep it!

?>
</body>
...

In code style->php->other "indent code in php tags" is selected, but this works only when there are no HTML tags present because in the html code style I have "do not indent children of: ...body..." and this gets inherited by the php code.
Am I missing something or it is not possible to set this in the way I want? (=that would be: do not indent children of body but DO indent the code in php tags)
Thanks!

1 comment

Hi Frank,
Could you please try the latest EAP build http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program?
The issue seems to be fixed in the build #129.240.

0

Please sign in to leave a comment.