Visual Web Developer 中的 PHP 语法突出显示?
我最近在 IIS 上安装了 PHP 5,但是,我找不到 VWD 的 PHP 语法突出显示插件或扩展。 我在哪里可以找到插件? 我还以为有官方的呢
I recently installed PHP 5 on IIS, however, I am unable to find a PHP syntax highlighting plug-in or extension for VWD. Where can I find a plug-in? I thought there was an official one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
考虑用于 Visual Studio 的 PHP IDE。
http://www.jcxsoftware.com/vs.php
我已经使用了这个,它添加了一个Visual Studio 提供了许多不错的 PHP 特定功能。
从他们的网站...
编辑器和文件管理
•PHP4 和 PHP5 支持
•PHP、Smarty、HTML、JavaScript、CSS、XML 和 XSLT 的语法着色 •
PHP、Smarty、HTML、JavaScript、CSS、XML 和 XSLT 的文件模板
•用于 PHP、Smarty、HTML、JavaScript、CSS、XML 和 XSLT
调试
的 Intellisense •XDebug 和 DBG 支持
•在一个会话中调试 PHP、JavaScript 和 .Net
•内置 Apache Web 服务器,便于调试。 预配置了 Php4、Php5、XDebug 和 DBG。
Consider PHP IDE for Visual Studio.
http://www.jcxsoftware.com/vs.php
I have used this and it adds a lot of nice PHP specific features to Visual Studio.
From their site...
Editor and File Management
•PHP4 and PHP5 Support
•Syntax Coloring for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
•File templates for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
•Intellisense for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
Debugging
•XDebug and DBG support
•Debug PHP, JavaScript and .Net in one single session
•Built-in Apache web server for ease of debugging. Preconfigured with Php4, Php5, XDebug and DBG.
我尝试过很多文本编辑器,有些是免费的,有些是商业的。 到目前为止,Visual Studio 是唯一一个拥有对我来说最有用的正确功能组合的软件。 因此,在 VS 中编写 PHP 对我来说很重要。
您可以欺骗 Visual Studio(希望还有 Visual Web Developer)认为
.php
文件是带有注册表 hack 的 C++ 文件。 语法突出显示足够接近,很有用。这篇博文解释了如何为所有版本的 VS 执行此操作: http: //blog.cumps.be/visual-studio-2008-and-php-coloring/
I've tried a lot of text editors, some free, some commercial. So far Visual Studio is the only one that has the right combination of features to be most useful to me. So, coding PHP in VS is important to me.
You can trick Visual Studio (and hopefully also Visual Web Developer) into thinking
.php
files are C++ with a registry hack. The syntax highlighting is close enough to be useful.This blog post explains how to do it for all versions of VS: http://blog.cumps.be/visual-studio-2008-and-php-coloring/
我不知道旧版本,但 VWD 2010 允许您将任何扩展链接到其选项中的任何类型的格式。
工具 - >选项
单击“显示所有选项”
展开“文本编辑器”
单击“文件扩展名”,
输入“php”并选择您想要的格式(我推荐自动编辑器选择器),单击“添加”
即可去! 下次加载页面时,您将看到更改。 如果您不喜欢,还有 20 种其他款式可供选择。
I don't know about older versions, but VWD 2010 allows you to link any extension to any type of formatting in its options.
Tools->Options
click 'show all options'
Expand 'Text editor'
click on 'file extensions'
type in 'php' and select how you want it to be formatted (I recommend the Automatic Editor Selector), click Add
And there you go! Next time you load the page you will see the changes. If you don't like it, there's 20 other styles to choose from.
PHP for Visual Web Developer 没有官方插件。 我相信这是因为 Microsoft 希望您使用他们的 .NET 产品(尤其是 ASP),该产品服务于大部分(如果不是全部的话)(我不能确切地说,因为我实际上不像 PHP 那样使用 ASP) PHP 的功能。
然而,有一些非常好的 PHP IDE。 您此处的列表
There is no official plugin for PHP for Visual Web Developer. I believe that this is because Microsoft would rather you use their .NET products, (notably ASP) which serves most of if not all of (I can't exactly say as I don't really use ASP as much as PHP) of the functionality of PHP.
There are however, some very good PHP IDEs out there. A list of which you Here
谢谢,我使用上一篇文章的“HTML 格式”而不是“自动编辑器选择器”
thx, I use the last post with "HTML format" instead "automatic editor selector"
我建议使用 Netbeans。 它具有 PHP 代码补全功能,并运行 xdebug 进行调试。 我已经使用它一年多了,并且对 PHP 的支持不断变得更好。
绝对值得尝试。
I would recommend using Netbeans. It has code completion for PHP and runs xdebug for debugging. I've been using it for over a year and the support for PHP just keeps getting better.
Definitely worth trying.
我会推荐带有此扩展的 Visual Studio:
http://phalanger.codeplex.com/
它是免费的,并且为您提供比大多数昂贵工具更多的功能。
I would recommend Visual Studio with this Extension :
http://phalanger.codeplex.com/
It is free and gives you more functionality than most of the expensive tools.
如果您使用的是 Windows,则有一个名为 notepad++ 的应用程序,它可以对数十种语言进行语法突出显示。 我将它用于 C,但我知道它有一个 php 语法荧光笔以及更多的语言。 在 Sourceforge 上查看一下。 如果您使用 Linux 或 Unix,您可以使用 K 高级文本编辑器 (kate)。 它还内置了一个控制台窗口。
if you're using windows there's an application called notepad++ that will do syntax highlighting for dozens of languages. I used it for C but I know it has a php syntax highlighter and many more languages coming along. Check it out on sourceforge. If your using Linux or Unix you can use K Advanced Text Editor (kate). It also has a console window built in.
我正在寻找一款与 Visual Studio 中内置的调试器一样有用的 PHP 调试器。 我到处搜索这个,但似乎没有一个效果很好。
What I am looking is for a debugger for PHP that is as useful as the one built into Visual Studios. I searched high and low for this and there seems to be none that works well.
我使用的是PHP Designer 2007 - 个人版5.0.2,是一个功能齐全的php编辑器,免费! 来自 mpsoftware[dot]dk/,但是我也很喜欢使用 MSVWD,现在我已经了解了如何使 php 文件在其中工作,我会坚持下去! 谢谢!
顺便说一句 Aptana Studio 看起来也很有前途
What I used is the PHP Designer 2007 - Personal Version 5.0.2 is a fully functional php editor, for free! from mpsoftware[dot]dk/, however I like using MSVWD a lot too, and now that I've seen how to make php files work in it, I gonna stick with that! Thanks!
btw Aptana Studio looks promising too tho
我发现的最接近 Visual Studio 的 PHP 环境是 CodeLobster。 它有 PHP 和 CSS 的免费版本,以及付费版本,其中专业版包括 CakePHP、CodeIgniter、Drupal、Facebook、JQuery、Joomla、Smarty、Symfony、WordPress 和 Yii 的插件。
它并不完美,但相当不错,而且基本版本是免费的。
The closest Visual Studio like PHP environment I have found yet is CodeLobster. It has a free version for PHP and CSS, as well as for pay versions that include for the Pro version a plug-in for CakePHP, CodeIgniter, Drupal, Facebook, JQuery, Joomla, Smarty, Symfony, WordPress and Yii.
It isn't perfect, but it is pretty good and free for the basic version.