Aptana: How to enable PHP Code Assist

If you are a PHP developer, you know that code refactor, code completion, and code assist is a very essential features that you’ll want to have on an IDE and Adobe’s Dreamweaver couldn’t give that to you. Don’t get me wrong, I love Dreamweaver, actually I’m still using it (on my Windows desktop) for HTML and web design mockups and it’s still one of the best HTML editor out there but that’s about it, an HTML editor, nothing more.

Have you ever tried Aptana? Well you should! If you’re a Web developer, building the next biggest, greatest, and newest application of the future then Aptana will be a great tool for you. It has code refactor, PHP code completion, code assist, FTP, SFTP, and SSH support and it’s FREE (Aptana Community Edition)! Plus it also has support for Ruby (Rails), Python, Adobe Air, and other language or platform. But wait there’s more! Ajax libraries (jQuery, Prototype/Scriptaculous, Adobe Spry, Dojo, etc). And if you’re a code version control freak, no worries! It has CVS, Subversion, or Git plugin support.

Enough with the promotion! Cause I will not get paid even doing so. But if you want an IDE with tons of support and features then Aptana is one of the best out there. Especially their code assist feature, it’s a top-notch. Aptana’s code completion for PHP’s common methods are default, you’ll have to install PHP plugin first to get this feature and for Aptana to recognize PHP codes and files.

To enable PHP Code Assist in Aptana, follow the simple instructions below. This will be useful if you have classes and methods that you want to be visible all over your project.

Code Assist will only work locally which means your source file must be in your local drive (not on a remote). But there’s a workaround for this, and we’ll get to that later on.

This is how to enable PHP Code Assist:

Local Projects

  1. Click “Project” tab (found on the left panel of Aptana environment).
  2. Create a new project (right click, New -> Project…).
  3. (on New Project window, under Aptana Projects) Select “PHP Project“.
  4. Click “Next” button, type in your project name then click “Finish” button.
  5. Select and right click on the newly created project and click on “Properties“.
  6. Select “Project Natures“.
  7. Tick “com.aptana.ide.editor.php.phpnature (PHP Nature)“.
  8. Then click “Ok” button.

Remote Projects

If your working with remote files (remote server or hosted site) then steps are different but almost similar to the above.

  1. Click “Project” tab (found on the left panel of Aptana environment).
  2. Create a new project (right click, New -> Project…).
  3. (on New Project window, under Aptana Projects) Select “Existing Hosted Site“.
  4. Click “Next” button, type in your project name then click “Next“.
  5. Choose or create a new remote location (FTP or SFTP) then click “Finish” button.

    Please note that the source file needs to be downloaded into your local drive, so choose “Yes” in the Download prompt/window. Be patient and wait for the download to complete.

  6. Select and right click on the newly created project and click on “Properties“.
  7. Select “Project Natures“.
  8. Tick “com.aptana.ide.editor.php.phpnature (PHP Nature)“.
  9. Then click “Ok” button.

After doing the changes in the source file, you can use the “Smart Sync” feature of Aptana to synchronize your local and remote source files. Another cool feature of Aptana.

Hope this helps!