繁体   English   中英

Sublime Text 2 PHP Endforeach,Endif和Endwhile混淆Widh HTML关闭标记

[英]Sublime Text 2 php endforeach, endif, and endwhile get confused widh html closing tag

因此,问题基本上是自动缩进。 我在用户配置中将此用于f12的自动缩进

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

并在带有HTML代码和PHP代码的somefile.php中

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

F12结果

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

有没有办法解决这个问题?

尝试将其更改为:

<div>
<?php 
    if(something){
      echo "hello world" // I assume you want to print this line to the screen
    }
 ?>
</div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM