want allman code formatting on php code in dreamweaver 2019

New Here ,
Dec 27, 2018 Dec 27, 2018

Copy link to clipboard

Copied

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

allman.PNG

Views

318

Likes

Translate

Translate

Report

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

Adobe Community Professional , 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";

Likes

Translate

Translate
Adobe Community Professional ,
Dec 27, 2018 Dec 27, 2018

Copy link to clipboard

Copied

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, the only real Dreamweaver alternative.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Dec 28, 2018 Dec 28, 2018

Copy link to clipboard

Copied

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, the only real Dreamweaver alternative.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Dec 28, 2018 Dec 28, 2018

Copy link to clipboard

Copied

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";

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

thanks sir , i done this job succefully

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Dec 27, 2018 Dec 27, 2018

Copy link to clipboard

Copied

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, Adobe Product User & Community Professional
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Dec 27, 2018 Dec 27, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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