문제

So the problem is basically the autoindent. I use this in the user configuration for auto indent on f12

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }

And in a somefile.php with html code and php code

<div>
    <?php if(something):?>
         hello world
    <?php endif;?>
</div>

F12 results in

<div>
    <?php if(something):?>
        hello world
<?php endif;?> //sublime is thinking the endif is a closing html tag.
</div>

Is there a way to fix this?

도움이 되었습니까?

해결책

try to change it to:

<div>
<?php 
    if(something){
      echo "hello world" // I assume you want to print this line to the screen
    }
 ?>
</div>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top