Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

want allman code formatting on php code in dreamweaver 2019

New Here ,
Dec 27, 2018 Dec 27, 2018

I want allman source formating in php code, but here have only retliff formate

allman.PNG

841
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Dec 28, 2018 Dec 28, 2018

the Bracket preference setting interface has not been integrated in DW... so you have to write hard in the code...

as Ben indicates, open the file beautify-php.js (in admin mode)

if you replaced online 295 the string "collapse" by "expand" it should do the job, but in some cases I noticed that it was not taken into account

so place a comment on line 295....

and add a hard line containing

opt.brace_style = "expand";

Translate
Community Expert ,
Dec 27, 2018 Dec 27, 2018

To see the script that formats the PHP code, go to C:\Program Files\Adobe\Adobe Dreamweaver CC 2018\www\extensions\default\BracketsDWBeautify\thirdparty\beautify-php.js

I have not found the section that is relevant to your problem, but it should not be too hard if you have the time.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2018 Dec 27, 2018

please help me how to change the beautify-php.js file for allman coding , thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2018 Dec 28, 2018

Line #34 of the script says:

brace_style (default "collapse") - "collapse-preserve-inline" | "collapse" | "expand" | "end-expand" | "none"

put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.

Then, when you do a find on 'brace_style' you will see all of the occurrences.

When I have more time, I will go through the file and where it is used on the preferences side. In the meantime, maybe someone else can help you out.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 28, 2018 Dec 28, 2018

the Bracket preference setting interface has not been integrated in DW... so you have to write hard in the code...

as Ben indicates, open the file beautify-php.js (in admin mode)

if you replaced online 295 the string "collapse" by "expand" it should do the job, but in some cases I noticed that it was not taken into account

so place a comment on line 295....

and add a hard line containing

opt.brace_style = "expand";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2018 Dec 28, 2018
LATEST

thanks sir , i done this job succefully

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2018 Dec 27, 2018

I'm not real fussy about code formatting since it has zero effect on site performance.   But if you feel strongly about code format styles, go to your Dreamweaver Help menu >  Submit Bug/Feature Request.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 27, 2018 Dec 27, 2018

I'm not arguing, but it's not question of performance there, but readability...

when we work on dozens of projects simultaneously and in addition with teams that have different requirements (isolated closures or not, tab vs spaces, extended verticality distance...) the formatting of the code quickly becomes an unavoidable necessity...

on the beta forum itself we have 4 different topics just on formatting

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines