Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse未在PHP文件(PDT)中正确缩进HTML_Php_Html_Eclipse_Formatting - Fatal编程技术网

Eclipse未在PHP文件(PDT)中正确缩进HTML

Eclipse未在PHP文件(PDT)中正确缩进HTML,php,html,eclipse,formatting,Php,Html,Eclipse,Formatting,我在EclipseLuna中使用PDT,每当我格式化PHP文件时,里面的html格式都不正确。这就是它的样子: <?php http_response_code(404); ?> <!DOCTYPE html> <html> <head> <?php $headTemplate = new Template('head'); $headTemplate->display(array(

我在EclipseLuna中使用PDT,每当我格式化PHP文件时,里面的html格式都不正确。这就是它的样子:

<?php http_response_code(404);  ?>
<!DOCTYPE html>
<html>
<head>
        <?php
        $headTemplate = new Template('head');
        $headTemplate->display(array(
                'title' => 'File not found (404)'
        ));
        ?>
    </head>
<body>
        <?php
        $headerTemplate = new Template('header');
        $headerTemplate->display();
        ?>
        <div class="page_header">
        <div class="margins_menu2">
            <h1 class="color_stylishred">
                <i class="fa fa-exclamation-triangle"></i>File not found (404)
            </h1>
        </div>
    </div>
    <div class="page">
        <div class="margins_page">The file you requested could not be found.</div>
    </div>
        <?php
        $footerTemplate = new Template('footer');
        $footerTemplate->display();
        ?>
    </body>
</html>

找不到文件(404)
找不到您请求的文件。
如您所见,头部和身体标记没有正确缩进。在哪里以及如何更改此设置?首选项中没有HTML格式选项。谢谢


作为一个额外的问题,有没有办法让eclipse在
标记之间缩进代码?

您应该在PDT上报告一个bugzilla:@zulus,那么它就是一个bug了?我想这可能与默认设置有关。我将制作一个新的bug报告。EclipseMars仍然不正确地格式化HTML(这就是为什么我在这里;第一个搜索结果),没有任何选项来更改它。然而,Zend Studio允许您更改它,尽管还不够。我发现PHPStorm的运气更好,但即使是在正确的格式和配置方面也受到限制,所以我尝试了不同的在线格式化程序,jsbeautify是我的最爱。