Reputation: 62404
Why CakePHP decided to build their own file format instead of .tpl is beyond me... despite that, i can't get syntax highlighting to work in Eclipse... I've followed this guide:
http://planetcakephp.org/aggregator/items/5452-opening-ctp-file-with-syntax-highlight-in-eclipse (dead link) but it doesn't work, I see an error about an unsupported content type for this file. I've added an association to the PHP editor for this file type and it still shows the issue.
Any ideas on how to get syntax highlighting to work?
Upvotes: 19
Views: 11452
Reputation: 50019
Make sure you have set the correct editor associations and content types
Go to settings (Window -> preferences
)
Content Types
Content Types
in the search box (should show under General -> Types
Text
, select PHP Content Type
*.ctp
by clicking on the Add button on the right sideFile Association
File Associations
in the search box on the leftUpvotes: 46
Reputation: 26
You can change the extension that CakePHP uses for view files to an extension that Eclipse likes. In the controller (or app_controller) add the following variable:
var $ext = '.tpl';
If you change the extension to "PHP" you may have problems because CakePHP will try to load a class that matches the filename.
Upvotes: 0