HTML code Inspection of blocks split up into several files in PhpStorm

微笑、不失礼 提交于 2019-12-13 16:14:56

问题


Is there a way to tell PhpStorm to only evaluate header.php together with footer.php (as a browser would do when running index.php)?

Consider a project containing 4 files

  • index.php    -   server side stuff, business logic
  • header.php -   html with some php prints
  • item.php      -   html with some php prints
  • footer.php   -   html with some php prints

index.php

<?php
//Do some important stuff
include 'templates/header.php';

foreach($some_array as $item){
    include 'templates/item.php';
}

include 'templates/footer.php';

header.php

<!DOCTYPE html>
<html lang="en">
<head><title><?=$foo;?></title></head>
<body>
    <div id="main">

item.php

        <div class="item"><?=$var;?></div>     

footer.php

    </div> <!-- close #main -->
</body>
</html>

When I do "Inspect Code..." on a project like this I get errors/warnings of the type "Closing tag matches nothing (at line x)" and similar. Is there a way to tell PhpStorm to only evaluate header.php together with footer.php? I Know that you can opt out "header.php" and "footer.php" from the scope but I would like to evaluate them as a unit.

来源:https://stackoverflow.com/questions/20508423/html-code-inspection-of-blocks-split-up-into-several-files-in-phpstorm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!