The NetBeans IDE for PHP Development, Page 2
Integrating NetBeans and Your Favorite PHP Framework
NetBeans 6.8 includes native support for the Symfony Framework (see this blog entry for a breakdown of available features), enabling features such as Symfony-specific code completion, the ability to navigate among project views and actions, and other useful features. Hopefully we'll see support for other frameworks such as the Zend Framework in the near future. In the meantime, you can easily add code completion for your favorite framework. To do so, right-click on your project's name within the Projects window and click on the Properties option. Click the PHP Include Path entry and then click the Add Folder... button (see Figure 3) to add your framework's library to the project's source inclusion path.
Figure 3. Adding a Path to Your Project's Source Inclusion Path: You can easily add code completion for your favorite framework.
In Figure 3 you can see I've added a path to the Zend Framework's library directory. When added, you'll have the convenience of code completion when using Zend Framework components, as depicted in Figure 4.
Figure 4. Using Zend Framework Code Completion: Just add a path to the Zend Framework's library directory.
PHP Manual Navigation
If I had a dollar for every time I've had to visit PHP's
date() function manual package, this article would have been submitted from a remote island in the Caribbean. To ease the time required to look up various functions within the PHP manual, you can install the PHP Manual Search plugin. This plugin automatically opens the proper manual page in your browser when you place the cursor within a function name in your script and click on the PHP logo on your toolbar. To install the plugin, navigate to Tools -> Plugins, and click on the Available Plugins tab. Search through the list until you find the PHP Manual Search listing, and click the Install button to install it.
Although not directly related to PHP, MySQL is such a commonplace database solution for PHP developers that it seems beneficial to mention NetBeans' useful native support for managing your MySQL databases. Although I typically use the command-line mysql client, phpMyAdmin, or SQLYog for managing and navigating my MySQL databases, NetBeans' native feature nonetheless offers a useful interface when you need to confirm the name of a particular column or table quickly.
To enter your MySQL server from NetBeans, navigate to Window -> Services to open the Services window. You'll see a tab named Databases within the window. Right-click on the MySQL Server entry, choose the Properties option, and enter your administrator password within the Basic Properties tab. Close the window and expand the MySQL Server tab, and you'll be presented with a list of available databases. From there you can connect to a database, peruse the available tables, and even create new tables, alter table structures, and manage data, as depicted in Figure 5.
Figure 5. Browsing MySQL Tables from Within NetBeans: Expand the MySQL Server tab and you'll be presented with a list of available databases.
Although the vi vs. Emacs war grows tiresome at times, the reasoning behind this enduring technical civil war is obvious: code editors are a crucial part of a developer's professional life. Like a woodworker's favorite brand of power tools or a hunter's choice of ammunition, the reasoning behind such preferences may not always be clear. However, most developers will nonetheless insist on the superiority of their IDE choice on the simple grounds that it is most productive when working in their environment. While my own technology preferences tend to be less ideologically based than others, I'd nonetheless agree that identifying and sticking with a specific IDE over the long term will undoubtedly make you a more efficient developer.
As this article indicates, NetBeans provides PHP developers with access to a powerful set of features capable of greatly enhancing productivity at all stages of development. And we didn't even get into the debugging or testing features -- I'll save that for a later article! If you're using a particular feature not mentioned in this article, tell us about it in the comments!
About the Author
Jason Gilmore is the founder of EasyPHPWebsites.com. He is the author of several popular books including, "Easy PHP Websites with the Zend Framework", "Easy PayPal with PHP", and "Beginning PHP and MySQL, Third Edition".