简体   繁体   中英

Eclipse Indentation PHP

I have a PHP project with mix of HTML and JavaScript. PHP scripts are inserted inline. Can I use Eclipse to indent the project? I just want the code to be properly indented and nor formatted. By formatting, I mean that Eclipse should not replace spaces with $nbsp and other changes.

Suggestions about tools apart from eclipse are also welcomed.

I think for PHP you should use Zend Studio and it also based on Eclipse which i think you are already familiar with.

By default it does not replace spaces with &nbsp and also you can also include your own custom formatting structure

After Installation Go to

Preferences -> PHP -> Code Style -> Formatter

Click on new Enter a Name you can create your own formatting structure

The same does for your JavaScript or other preferred supported Zend Studio Languages

:)

I found this question searching for ways to improve (free and OpenSource) Zend Eclipse's code indentation. NetBeans for PHP has far superior code indentation, but I've always had trouble getting code completion to work well on framework based projects: Zend Framework, CakePHP, etc. The code completion in Zend Eclipse works really well. Aptana is decent, too.

NetBeans is great at syntax highlighting and formatting pages that are a heavy mix of PHP, JavaScript and HTML. Dreamweaver is really bad about losing the highlighting when mixing languages. The highlighting is decent in Eclipse, but fixing the indenting in PHP alone is just consuming too much time.

You can try Komodo Edit

http://www.activestate.com/komodo-edit/downloads

Very lightweight & have code indented feature & its Free !!

Hope Helps.

~K

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM