This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257574 - NetBeans PHP and HTML formatter bug
Summary: NetBeans PHP and HTML formatter bug
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: All All
: P4 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 201961 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-15 01:24 UTC by mmilanovic
Modified: 2016-08-12 10:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot exapmle (14.79 KB, image/png)
2016-01-15 01:24 UTC, mmilanovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mmilanovic 2016-01-15 01:24:13 UTC
Created attachment 158136 [details]
Screen shot exapmle

I'm having troubles with formatting HTML code inside PHP functions. As you can see on attachment, closing line is indented badly, because html tag is not closed (and it shouldn't be closed inside that function). Is anyone working on NetBeans planning on making formatter normal, or should I consider switching to Eclipse or PhpStorm?
Comment 1 Tomas Mysik 2016-08-10 08:43:29 UTC
Your code is very unusual IMHO; usually, one defines a string variable and echo's it (or the string directly). So, your code would be something like:

<?php

function getHeader($title) {
    $header = '
        <html>
            <head><title>' . $title . '</title></head>
            <body>...';
    echo $header;
}

getHeader('my page');

Lowering to P4, thanks for reporting.
Comment 2 Tomas Mysik 2016-08-12 10:10:30 UTC
*** Bug 201961 has been marked as a duplicate of this bug. ***