Report a bug!

(DW 2018) Apply source formatting to the php pages, strange behaviour

When I try to apply the source formatting to the php pages, the code show indent and spaces not necessary.
Instead if I use the same process on a html page, the source code is formatted correctly.
Is a bug or Dreamweaver (Adobe) consider PHP code in a different way?

4 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Michele shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    7 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Dreamweaver User Since v3 commented  ·   ·  Flag as inappropriate

        I have a separate post about PHP code getting broken when using source formatting here : https://dreamweaver.uservoice.com/forums/382851-adobe-dreamweaver-bugs/suggestions/33786583-apply-source-formatting-breaks-php-code-is-compl

        I'm adding my comments here too in the hope this eventually gets fixed. I updated to Dreamweaver 18.2 and the problem still exists

        Just a couple of examples of snippets of code that get broken:

        <input <?php if (!(strcmp($row['var'], "Y"))) {echo "checked";} ?> type="checkbox" name="someval<?php echo $cnt1; ?>" id="someval<?php echo $cnt1; ?>" value="Y" />

        and:

        <input <?php if (!(strcmp($row['var'], "ThisValue"))) {echo "CHECKED";} ?> type="radio" name="somevalue_<?php echo $cnt1; ?>" id="somevalue_<?php echo $cnt1; ?>_1" value="ThisValue" />

        The code formatting options adds space and line breaks in code that are necessary and sometimes completely break the code.

      • Mark G. commented  ·   ·  Flag as inappropriate

        On the same subject...

        I don't think I'm doing something wrong. Using DW 18.1, build 10155, I have a ??.class.php file that contains code that contains no bug that I have yet found. This is a little bit of that which I wrote:
        //////
        public function getAndSendDeal( $inpDealId ) {
        //////
        Apply source formatting does this to it:
        //////////////////////
        public
        function getAndSendDeal( $inpDealId ) {
        ////////
        A second Apply source formatting does this to it:
        //////////////////////
        public

        function getAndSendDeal( $inpDealId ) {
        ////////
        OK, not a critical bug in DW, but is this impressive behaviour?

      • Michael Chang commented  ·   ·  Flag as inappropriate

        same problem here. especially forms get destroyed in php-pages when applying source formatting.
        within quoteation marks DW generates spaces...

      • Anonymous commented  ·   ·  Flag as inappropriate

        can we add some more details ? so in case, please will it be possible to take into account the following points:
        - having a setting per language (css, scss, javascript, html...)
        - having a setting per project (i.e some team works using tab, some others works using space...)
        - currently when a language (HTML) contains other (CSS, JS) that doesn't apply correctly to the embeded language
        - linking the lint, format and coloring will be a real plus

      Feedback and Knowledge Base