如何在Eclipse中使用JS或HTML编辑器打开PHP文件 [英] How to open a PHP file with a JS or HTML Editor in Eclipse

查看:707
本文介绍了如何在Eclipse中使用JS或HTML编辑器打开PHP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常用它的默认编辑器打开一个文件。因此,在默认的PHP编辑器中打开.php文件,并将其视为PHP文件。

I normally open a file with it's default editor. Thus a .php file is opened in the default PHP editor and treated like a PHP file.

但是,我的PHP文件中的代码通常包含大量的JS或HTML。在这些情况下,使用JS或HTML编辑器打开这样的PHP文件会很不错。现在,这是一个痛苦,因为我必须点击打开方式 - >其他然后选择JS或HTML编辑器。

However, often the code in my PHP files contains a lot of JS or HTML. In these cases it would be nice to open such PHP files using a JS or HTML Editor. Right now, this is a pain since I have to click on Open With -> Other and then choose the JS or HTML Editor.

有没有办法将JS或HTML编辑器作为选项添加到打开菜单?

Is there a way to add the JS or HTML editor as an option to the Open With menu ?

推荐答案

尝试将PHP文件类型添加到内容类型。进入Eclipse首选项常规>内容类型

Try adding the PHP file type to Content types. Go into Eclipse Preferences General > Content Types


  1. 在内容类型中选择 JavaScript源文件

文件关联中,点击添加并添加 * .php 如下:

In the File associations click Add and add *.php like so :

< img src =https://i.stack.imgur.com/PKZ0U.pngalt =在此处输入图像说明>

然后在打开方式菜单中对于php文件,JS编辑器应该像这样开始出现:

Then in the Open With menu for php files, the JS Editor should start appearing like so :

这篇关于如何在Eclipse中使用JS或HTML编辑器打开PHP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆