Rio Bautista’s TechLog

Tech solutions worth remembering

Syntax highlighting CakePHP using Eclipse

I’m still waiting for an Eclipse plugin for CakePHP so for now I’m settling with the available PHP syntax highlighting on eclipse. So far I had to define two file-types e.g. *.thtml (for 1.1.x.x) and *.ctp (for 1.2.x.x). Do the following steps for each file-type you want to be associated with the PHP-Editor:

  1. Open your Eclipse workspace;
  2. Click on Window | Preferences;
  3. On the Preference Dialog expand the General node on the tree;
  4. Click on Content-Types under General;
  5. On the right panel under Content-Types, expand the Text node;
  6. Select PHP Source under the Text node;
  7. You’ll see the list of files associated on the list below e.g. File-Associations;
  8. Click on the Add button and type the fie extension e.g. *.ctp under file-type;
  9. Click on Ok to add the file-type;
  10. Click on Ok to close the Preference Window;

If there’s a currently opened file (with the extension you added), it will not reflect syntax highlighting until you close and reopen the file. You’re all set!


January 15, 2008 - Posted by | CakePHP, php


  1. Thanks!

    Comment by vicox | April 29, 2008 | Reply

  2. Thanks You

    Comment by Angela | October 2, 2008 | Reply

  3. Needed that, thanks!

    Comment by Jamie | December 4, 2008 | Reply

  4. sweet – thanks!

    Comment by Pete | December 21, 2008 | Reply

  5. Thanks!

    Comment by Juri | January 13, 2009 | Reply

  6. already i know

    Comment by Dokuro | March 30, 2009 | Reply

  7. Excellent site, keep up the good work

    Comment by Bill Bartmann | September 3, 2009 | Reply

  8. Thanks a lot for that, very helpful.

    Comment by Gary Reckard | October 20, 2009 | Reply

  9. Under Linux Fedora 12 I had to install additional PHP plugin for Eclipse in order to get the syntax highlightning…

    Comment by Lamy | February 22, 2010 | Reply

  10. Anybody know if there’s a way to force a specific Content-Type to be default?

    The problem I’m having is using the ShellEd Eclipse extension with some bash scripts that have no extension. However, eclipse doesn’t seem to allow a “*” or “*.*” rule in the Content-Type dialog…

    Comment by James | February 10, 2011 | Reply

  11. Thank you.

    Comment by Matt | May 19, 2011 | Reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: