How can I get HTML syntax highlighting in my editor for CakePHP?

纵饮孤独 提交于 2019-12-11 02:08:38

问题


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?


回答1:


Configuring in Aptana Editor

Quoted from aptana docs

  1. From the Window menu, select Preferences..., and then choose General > Editors > File Associations.
  2. Add the appropriate file type.
  3. Next to the File Types list, click the Add button.
  4. In the New File Type pop-up window, type the appropriate file extension (e.g. ".ctp" or ".thtml").
  5. Click OK to add the New File Type to the List.
  6. Associate the new file type with Aptana.
  7. On the File Types list, select the file type that you just added.
  8. Next to the Editor Associations list, click the Add button.
  9. On the Editor Selection pop-up window, select the editor that you want to associate with your file type.
  10. Click OK to add the editor.
  11. The new is now associated with the specified file type.
  12. Click OK to apply your changes and close the Preferences window.

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




回答3:


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

done :-)




回答4:


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

  1. Right Click on your Projects, Select Properties
  2. 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)
  3. Next we're going to click on "PHP Buildpath" and select the "External Folders" tab
  4. Add the location of a plane jane CakePHP install

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



来源:https://stackoverflow.com/questions/811656/how-can-i-get-html-syntax-highlighting-in-my-editor-for-cakephp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!