Skip to main content
Participating Frequently
April 12, 2020
Question

want allman code formatting on php code in dreamweaver 2020

  • April 12, 2020
  • 1 reply
  • 1184 views

Dear team,

I want Allman code formating on php code.

i use .jsbeautifyrc process display in below link.

https://helpx.adobe.com/in/dreamweaver/using/format-code.html

but in if else condition display code

if()

{

}

else {

}

but i want

if()

{

}else

{

}

please help me.

thanks. 

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    April 12, 2020

    http://www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style/

     

    Allman

    if (x == y)
    {
      x++;
     foo();
    }
    else
    {
      x--;
      bar();
    }

     

    Legend
    April 12, 2020

    Limited PHP code formatting options are in this file on windows (make a backup of the file first):

    C:\Program Files\Adobe\Adobe Dreamweaver Next\www\extensions\default\BracketsDWBeautify\default.jsbeautifyrc - at the bottom PHP otions for format source code look something like this :

    "php": {
    "eol": "\n",
    "preserve_newlines": true,
    "max_preserve_newlines": 3,
    "space_after_anon_function": true,
    "brace_style": "collapse",
    "keep_array_indentation": false,
    "keep_function_indentation": false,
    "space_before_conditional": true,
    "break_chained_methods": false,
    "eval_code": false,
    "unescape_strings": false,
    "wrap_line_length": 0,
    "wrap_attributes": "auto",
    "end_with_newline": false,
    "comma_first": false,
    "space_in_paren":true
    }

     

    Alternatively you can put a .jsbeautifyrc file in the root of your current project

    Paul-M - Community Expert
    Participating Frequently
    April 17, 2020