如何在CakePHP的编辑器中获取HTML语法高亮?

时间:2022-03-04 07:37:39

I use Notepad++ and Aptana for editing my CakePHP code? Is there any way to get basic html syntax highlighting for CakePHP's .ctp template files? It's a lot harder for me without any coloring going on. Any ideas?

我使用Notepad ++和Aptana编辑CakePHP代码?有没有办法获得CakePHP的.ctp模板文件的基本html语法高亮?没有任何着色,对我来说要困难得多。有任何想法吗?

4 个解决方案

#1


Configuring in Aptana Editor

在Aptana编辑器中配置

Quoted from aptana docs

引自aptana docs

  1. From the Window menu, select Preferences..., and then choose General > Editors > File Associations.
  2. 从Window菜单中,选择Preferences ...,然后选择General> Editors> File Associations。

  3. Add the appropriate file type.
  4. 添加适当的文件类型。

  5. Next to the File Types list, click the Add button.
  6. 在“文件类型”列表旁边,单击“添加”按钮。

  7. In the New File Type pop-up window, type the appropriate file extension (e.g. ".ctp" or ".thtml").
  8. 在“新建文件类型”弹出窗口中,键入相应的文件扩展名(例如“.ctp”或“.thtml”)。

  9. Click OK to add the New File Type to the List.
  10. 单击“确定”将“新文件类型”添加到“列表”中。

  11. Associate the new file type with Aptana.
  12. 将新文件类型与Aptana相关联。

  13. On the File Types list, select the file type that you just added.
  14. 在“文件类型”列表中,选择刚刚添加的文件类型。

  15. Next to the Editor Associations list, click the Add button.
  16. 在“编辑者关联”列表旁边,单击“添加”按钮。

  17. On the Editor Selection pop-up window, select the editor that you want to associate with your file type.
  18. 在“编辑器选择”弹出窗口中,选择要与文件类型关联的编辑器。

  19. Click OK to add the editor.
  20. 单击“确定”以添加编辑器。

  21. The new is now associated with the specified file type.
  22. 新的现在与指定的文件类型相关联。

  23. Click OK to apply your changes and close the Preferences window.
  24. 单击“确定”以应用更改并关闭“首选项”窗口。

Check out this link

看看这个链接

#2


You probably just have to select Language -> Html in the menu bar. You can set the association in Settings -> Style Configurator -> Html

您可能只需在菜单栏中选择语言 - > Html。您可以在设置 - >样式配置器 - > Html中设置关联

#3


Settings -> Styler Configurator -> Language: HTML -> User ext: ctp

设置 - > Styler配置器 - >语言:HTML - >用户分机:ctp

done :-)

#4


Another little tip that I picked up on.....to get some basic syntax completion in Aptana:

我接受的另一个小提示.....在Aptana中获得一些基本的语法完成:

  1. Right Click on your Projects, Select Properties
  2. 右键单击您的项目,选择属性

  3. Goto the "Project Natures" tab and make sure that the PHP component is clicked (If not you will have to click it, close the properties window and reopen it)
  4. 转到“Project Natures”选项卡并确保单击PHP组件(如果不是,则必须单击它,关闭属性窗口并重新打开它)

  5. Next we're going to click on "PHP Buildpath" and select the "External Folders" tab
  6. 接下来,我们将单击“PHP Buildpath”并选择“外部文件夹”选项卡

  7. Add the location of a plane jane CakePHP install
  8. 添加平面简易CakePHP安装的位置

Let Aptana re-profile the project and viola....you have some syntax completion. It's not perfect....but it's better than nothing!

让Aptana重新描述项目和中提琴....你有一些语法完成。它并不完美......但它总比没有好!

#1


Configuring in Aptana Editor

在Aptana编辑器中配置

Quoted from aptana docs

引自aptana docs

  1. From the Window menu, select Preferences..., and then choose General > Editors > File Associations.
  2. 从Window菜单中,选择Preferences ...,然后选择General> Editors> File Associations。

  3. Add the appropriate file type.
  4. 添加适当的文件类型。

  5. Next to the File Types list, click the Add button.
  6. 在“文件类型”列表旁边,单击“添加”按钮。

  7. In the New File Type pop-up window, type the appropriate file extension (e.g. ".ctp" or ".thtml").
  8. 在“新建文件类型”弹出窗口中,键入相应的文件扩展名(例如“.ctp”或“.thtml”)。

  9. Click OK to add the New File Type to the List.
  10. 单击“确定”将“新文件类型”添加到“列表”中。

  11. Associate the new file type with Aptana.
  12. 将新文件类型与Aptana相关联。

  13. On the File Types list, select the file type that you just added.
  14. 在“文件类型”列表中,选择刚刚添加的文件类型。

  15. Next to the Editor Associations list, click the Add button.
  16. 在“编辑者关联”列表旁边,单击“添加”按钮。

  17. On the Editor Selection pop-up window, select the editor that you want to associate with your file type.
  18. 在“编辑器选择”弹出窗口中,选择要与文件类型关联的编辑器。

  19. Click OK to add the editor.
  20. 单击“确定”以添加编辑器。

  21. The new is now associated with the specified file type.
  22. 新的现在与指定的文件类型相关联。

  23. Click OK to apply your changes and close the Preferences window.
  24. 单击“确定”以应用更改并关闭“首选项”窗口。

Check out this link

看看这个链接

#2


You probably just have to select Language -> Html in the menu bar. You can set the association in Settings -> Style Configurator -> Html

您可能只需在菜单栏中选择语言 - > Html。您可以在设置 - >样式配置器 - > Html中设置关联

#3


Settings -> Styler Configurator -> Language: HTML -> User ext: ctp

设置 - > Styler配置器 - >语言:HTML - >用户分机:ctp

done :-)

#4


Another little tip that I picked up on.....to get some basic syntax completion in Aptana:

我接受的另一个小提示.....在Aptana中获得一些基本的语法完成:

  1. Right Click on your Projects, Select Properties
  2. 右键单击您的项目,选择属性

  3. Goto the "Project Natures" tab and make sure that the PHP component is clicked (If not you will have to click it, close the properties window and reopen it)
  4. 转到“Project Natures”选项卡并确保单击PHP组件(如果不是,则必须单击它,关闭属性窗口并重新打开它)

  5. Next we're going to click on "PHP Buildpath" and select the "External Folders" tab
  6. 接下来,我们将单击“PHP Buildpath”并选择“外部文件夹”选项卡

  7. Add the location of a plane jane CakePHP install
  8. 添加平面简易CakePHP安装的位置

Let Aptana re-profile the project and viola....you have some syntax completion. It's not perfect....but it's better than nothing!

让Aptana重新描述项目和中提琴....你有一些语法完成。它并不完美......但它总比没有好!