最近在玩CakePHP,这个框架的View文件扩展名全是.ctp,这样编辑的时候没有php的高亮显示感觉很不爽,所以就试了试让他用Eclipse自带的PHP Editor:
1>在打开的ctp文件中点击右键,选择preferences
[img]http://dl.iteye.com/upload/attachment/292769/09cd57c2-d100-33a6-9b37-5a0443cb5f32.jpg[/img]
2>在弹出的窗口中点击Editor
3>点击File Associations,在弹出的窗口的File type列表框旁边点击Add,添加*.ctp.然后保持选中*.ctp的状态不变,在下面的列表框附近点击Add,为*.ctp添加Associated Editor,选中PHP Editor
[img]http://dl.iteye.com/upload/attachment/292771/50f2fe92-0e03-3b5c-bd02-69c2c8b9423b.jpg[/img]
4>在2>中弹出的窗口中选择Content Types,展开Text,找到PHP Content Type,然后添加*.ctp.
[img]http://dl.iteye.com/upload/attachment/292773/46d8b00a-e287-3214-85f9-aa4c94e56c97.jpg[/img]
5>到此设置完成,你再打开ctp文件的时候高亮显示就是php的了。
[img]http://dl.iteye.com/upload/attachment/292775/5f5a32a1-059f-3631-8500-7c32ca07c188.jpg[/img]
1>在打开的ctp文件中点击右键,选择preferences
[img]http://dl.iteye.com/upload/attachment/292769/09cd57c2-d100-33a6-9b37-5a0443cb5f32.jpg[/img]
2>在弹出的窗口中点击Editor
3>点击File Associations,在弹出的窗口的File type列表框旁边点击Add,添加*.ctp.然后保持选中*.ctp的状态不变,在下面的列表框附近点击Add,为*.ctp添加Associated Editor,选中PHP Editor
[img]http://dl.iteye.com/upload/attachment/292771/50f2fe92-0e03-3b5c-bd02-69c2c8b9423b.jpg[/img]
4>在2>中弹出的窗口中选择Content Types,展开Text,找到PHP Content Type,然后添加*.ctp.
[img]http://dl.iteye.com/upload/attachment/292773/46d8b00a-e287-3214-85f9-aa4c94e56c97.jpg[/img]
5>到此设置完成,你再打开ctp文件的时候高亮显示就是php的了。
[img]http://dl.iteye.com/upload/attachment/292775/5f5a32a1-059f-3631-8500-7c32ca07c188.jpg[/img]