Adnan
Adnan

Reputation: 2031

Dreamweaver extension to beautify PHP/JavaScript/jQuery code

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.

Upvotes: 14

Views: 25316

Answers (10)

user3448798
user3448798

Reputation: 46

Online solutions for validation and formatting JavaScript:

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

Format JavaScript code:
http://jsbeautifier.org/

Upvotes: 3

Bryan Miller
Bryan Miller

Reputation: 3323

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 :)

Upvotes: 1

MiPhyo
MiPhyo

Reputation: 49

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. :)

Upvotes: -4

samia
samia

Reputation: 21

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.

Upvotes: 2

Shady Nawara
Shady Nawara

Reputation: 502

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

Upvotes: 2

antony
antony

Reputation: 2893

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

Upvotes: 2

Drmzindec
Drmzindec

Reputation: 814

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.

Upvotes: 0

Danilo Celic
Danilo Celic

Reputation: 2467

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.

Upvotes: 0

Phill Pafford
Phill Pafford

Reputation: 85358

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"

Upvotes: 0

Jake N
Jake N

Reputation: 10583

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'

Upvotes: 1

Related Questions