[Eclipse] How to configure PHP code recognition and coloring in files with extensions like html
I researched how to configure Eclipse 3.7 to recognize PHP code in files with extensions like html and enable syntax coloring, so here’s a memo of the steps.
■ What I want to do
・Make it possible to open with PHP editor
・Enable syntax coloring
Steps to configure Eclipse to display *.html files with PHP editor syntax coloring
Go to Window → Preferences → General → Editors → File Associations
Click “Add” in “File Types”, enter the file extension you want to add, and click “OK”. ・This time enter “*.html”
Select the added item (*.html) from “File Types”, then click “Add” in “Associated Editors”.
In “Choose the editor”, select “Internal editors”, choose the editor you want to use for this file type, and click “OK”. ・This time select “PHP Editor”
Go to Window → Preferences → General → Content Types
In Content Types → Text → PHP Content Type, click “Add” in “File associations”.
In “Content Type”, enter what you entered in step 2 (*.html) and click “OK”.
Finally, restart Eclipse.
Now you can open files with *.html extension in the PHP editor with syntax coloring enabled.
・Eclipse上でhtmlファイル内のPHPのコードを認識させる方法 - Coding Edge会議室
・Eclipseエディタの色設定 - 役立たずのプログラマーブログ
That’s all from the Gemba.