Ivo Jansch

Zend Studio is a great IDE and we use it a lot at Ibuildings (in addition to NetBeans, PDT and Vim). One of the nice features is the code formatter that helps develop code according to agreed standards, which is useful to keep projects consistent.

One problem we have with the current versions of Zend Studio is that its default Zend Framework formatter is not consistent with the official Zend Framework coding standard. Luckily, that can be easily fixed. Sandy Pleyte, one of our developers, created a formatting file for Zend Studio that does adhere to the formal standard. There might be a few issues here and there but we’ve found it to work much better than the default one in Zend Studio. Because it might be helpful to others, we’re sharing the formatter file with anyone that’s interested. Download the file and read on for instructions.

Instructions

Download the above file to your desktop. Open the Zend Studio formatter preferences, which will give you the following screen:

Click the ‘import’ button and import the file that you’ve downloaded. Voila, your formatter now uses the Zend Framework official coding standards. If you find any issues with this formatter, please let us know in the comments below.

ATK formatter

If you use the ATK business framework, you might also be interested in the following formatter, which is similar to the ZF formatter but adds support for some of ATK’s coding conventions:

Have fun!

Like it? Share it!
  • email
  • Twitter
  • Facebook
  • Digg
  • StumbleUpon
  • del.icio.us
  • LinkedIn
  • Reddit
  • Technorati
  • DZone

Recommended reading:

11 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. It’s better but problems with long lines are still. I tested classed and in array are more blank lines added.

  2. Sandy Pleyte said

    You are right, the auto wrap feature is disabled because it doesn’t always looks nice (and my colleagues didn’t want it turned on). Most people here set the show print margin on 80 chars (Preferences->General->Editors->Text Editors). But you can also edit the formatter rules and go to the Line Wrapping tab to change the Line wrapping policy.

    About the blank lines in array’s that’s a bug of Zend Studio as far as I know. I can’t find a setting to solve that problem.

  3. Slightly offtopic, but there’s a new kid in webdevelopment IDE town: WebIDE / PHPStorm.

    Download it from http://www.jetbrains.com/webide/

    It takes little time to get used to it, and is -in my opinion- way better then ZendStudio/PDT/Netbeans (and VI, ofcourse ;)).

  4. dmitrybelyakov said

    Hi Ivo!

    Thanks for a handy tool. One question though – do you run automated checkstyle tests on your code at ibuildings?

  5. @dimitrybelyakov We use phpUnderControl and Hudson for continuous integration and have PHP_CodeSniffer set up to validate the code. (We also have sniffs we use in Zend Studio to validate as we code)

Continuing the Discussion

  1. Zend Studio formatter for Zend Framework and ATK linked to this post on March 18, 2010

    [...] Framework formatter is not consistent with the official Zend Framework coding standard Read more: Click Here…Read Other Interesting Posts in PHP TutorialsEasy BelongsTo Filtering For PaginationAJAX Helper with [...]

  2. Ibuildings techPortal: Zend Studio formatted for Zend Framework and ATK | Development Blog With Code Updates : Developercast.com linked to this post on March 18, 2010

    [...] at the formatting it uses for your applications, download the tool and follow the instructions in the post to get it working in your IDE. [...]

  3. Zend Studio code formatter for Zend Framework -HackIX linked to this post on March 21, 2010

    [...] via tech­Por­tal. [...]

  4. W drodze ku szczęściu » Blog Archive » Zend Framework – mega zestawienie linked to this post on April 28, 2010

    [...] Formatowanie do Zend Studio zgodne ze standardami Zend Framework [...]