Dreamweaver extension to beautify PHP/JavaScript/jQuery code
Asked Answered
C

10

14

I'm looking so long for a Dreamweaver extension to auto beautify PHP / JavaScript / jQuery code. Currently Dreamweaver can beautify only HTML and CSS (Apply Source Formatting).

Any kind of help will be much appreciated.

Colitis answered 11/1, 2010 at 7:46 Comment(4)
weird. My copy of DW (CS5) formats PHP code while typing, but not JS, jQ, HTML and CSS. How do you do it for HTML and CSS?Eric
DW is pretty expensive peace of software that don't have some basic features - like code formatting for JavaScript or PHP >:(Graminivorous
There is an extension to format javascript source - adobe.com/cfusion/exchange/…Carrasquillo
@PraveenVijayan — there is no javascript formatting extension for DW.Pancho
M
3

Online solutions for validation and formatting JavaScript:

Validate JavaScript code:
http://www.javascriptlint.com/

Format JavaScript code:
http://jsbeautifier.org/
Marieann answered 1/3, 2015 at 20:11 Comment(0)
W
2

You can use PhpEdit, it's an extra debugger!
DW doesn't do debug, you find the error if and only if you run your code.

With PhpEdit, it is onTime.

Witter answered 23/4, 2012 at 11:4 Comment(1)
Unfortunately this tool doesn't exists anymore and their website is very much broken, which makes this answer obsolete.Roche
D
2

For the PHP side of things use https://github.com/fabpot/PHP-CS-Fixer

This short excerpt and more information is taken from the README.

Installation:

Download the php-cs-fixer.phar file and store it somewhere on your computer.

Usage:

The fix command tries to fix as much coding standards problems as possible on a given file or directory:

php php-cs-fixer.phar fix /path/to/dir

php php-cs-fixer.phar fix /path/to/file
Deprived answered 5/6, 2012 at 5:40 Comment(0)
B
2

I have found this great dreamweaver extenstion, just give it a try

Their Homepage: http://www.decodize.com/projects/

extension download page: http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=2107536

Burget answered 8/8, 2012 at 10:16 Comment(0)
T
1

Maybe try http://www.javascriptlint.com/ says it works on some IDEs, maybe DW is one of them.

Try googling, but use 'code format' not 'beautify'

Thoreau answered 11/1, 2010 at 20:14 Comment(0)
A
1

I was wondering if you could elaborate on how to set this up. I see the CSS and Tag Libraries options under "Advanced Formatting", but I am stuck at that point as to how to get my PHP to start auto-indenting.

Or, if Dreamweaver has somehow fixed this problem, let me know! It seems like every other IDE has an auto-indent feature! Thanks :)

Angelia answered 12/6, 2014 at 21:21 Comment(0)
Z
0

It's been a while since I have used DW, I use Aptana now and there is an option to format the code from one of the drop down menus. Just use something like "control a" (To select all your code), "control f" (To format your code). There might be another key combination but I think this will work if memory serves.

Maybe "esc control f"

Zsa answered 12/1, 2010 at 13:38 Comment(0)
S
0

I've not seen anything for Dreamweaver, but if you can copy ans paste the code, http://jsbeautifier.org/ can help you with making code look a good bit better. I've just tried it on some packed JavaScript and it worked out very well. You can also download the application and run it locally (it's only HTML and JavaScript), so you won't need an internet connection to get your code prettier.

Simone answered 15/1, 2010 at 0:45 Comment(0)
A
0

Best way i found is to set the way Dreamweaver displays code yourself. Sure it takes some time to do but its worth it.

Here is how:

Dreamweaver: Edit > Preferences > Code Format

Then under Advanced Formatting you can pick CSS... or Tag Libraries...

You can make any of your code look as it should this way.

Like i said, will take some time but do it once and you can keep using it with all your future Dreamweaver versions.

Advocaat answered 20/4, 2012 at 16:46 Comment(0)
S
-4

In Dreamweaver CS6 no need any other extension or tools. Just select your code and then Go to 'Commands' > 'Apply Source Formatting' or 'Apply Source Formatting to Selection'

Done. :)

Scandinavia answered 1/4, 2014 at 3:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.