【发布时间】:2011-08-24 19:14:15
【问题描述】:
当我开始编辑像 add.ctp 这样的视图文件时,我在 Eclipse 中没有得到任何语法高亮显示。 如何获得 add.ctp 的语法高亮显示?
【问题讨论】:
标签: php eclipse cakephp editor syntax-highlighting
当我开始编辑像 add.ctp 这样的视图文件时,我在 Eclipse 中没有得到任何语法高亮显示。 如何获得 add.ctp 的语法高亮显示?
【问题讨论】:
标签: php eclipse cakephp editor syntax-highlighting
导航到 Window -> Preferences -> General -> Content Types -> PHP Content Type 并 添加 为 *.ctp。然后关联您希望 Eclipse 用于语法高亮的任何类型的编辑器(php、html 等)。
【讨论】:
下面大师的评论是最好的建议,对我有用。
首选项 > 常规 > 内容类型 > PHP > 添加 *.ctp
建议选择 PHP 而不是 HTML = 即使它们是包含大量 HTML 的视图文件,您仍需要 PHP 类型才能看到清晰标记的 PHP 代码段。您还可以利用菜单中的源工具。
【讨论】:
在一些新版本中,您可以添加它,Window -> Preferences -> General -> Content Types ->Text -> PHP Content Type 并为 *.ctp 添加新的文件关联。
【讨论】: