Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP syntax highlighting in Visual Web Developer?

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.

like image 658
teh_noob Avatar asked Jul 03 '09 04:07

teh_noob


3 Answers

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.

like image 169
Jeffrey Hines Avatar answered Sep 21 '22 13:09

Jeffrey Hines


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/

like image 24
spoulson Avatar answered Sep 20 '22 13:09

spoulson


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.

like image 31
john ktejik Avatar answered Sep 20 '22 13:09

john ktejik