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 Rio | CakePHP, php | | 8 Comments

8 Comments »

  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


Leave a comment