Is there any way to tell Netbeans to highlight PHP code in HTML files? I am using Zend Framework, where a lot of PHP code is included in the view files.
Thanks, but i have found the solutions.
You can set in the Options Screen - Misc - Files. The Type associated with .phtml. After switching it to php it works.
Related
How I can enable PHP syntax and PHP autocomplete in HTML files in vscode?
Default vscode can't see PHP in HTML files.
The PHP Intelephense extension will forward requests to the vscode html language server when outside of <?php ?> and provide php intellisense when inside <?php ?> you must be in php language mode.
*Disclaimer - I'm the author
There is an issue when you mix match with html, php and js. They might fix. Meanwhile, you have to look for other tools. issue -
https://github.com/Microsoft/vscode/issues/6616
There are tools to do so. Search them on google.
One of that kind is
https://marketplace.visualstudio.com/items?itemName=HvyIndustries.crane
I have installed Adobe-Brackets 0.41. And I installed following extensions :
Integrated Development
PHP Syntax Hint
QuickDocsPHP
But when I writing PHP code (for instance mysql_) and pressing Ctrl+Space it won't complete the PHP codes!
Does brackets support PHP auto-complete at all?
Any ideas?
P.S:
Auto-Complete works fine with HTML and CSS codes.
There is a hint extension for brackets now!
https://github.com/mackenza/Brackets-PHP-SmartHints
Btw I hope you like my QuickDocsPHP extension ;)
I got the PHP Tools professional version, but realized that it only has php intellisense, and that it only has color highlighting for HTML. While html itself admittedly isn't difficult, I would like to have intellisense for it as well.
Does anyone know of a way that I can link both PHP and HTML intellisense to a single extension?
I tried to go to options->Text Editor->File Extension and set the php extension to the HTML editor, but it removed the PHP Tools intellisense and just replaced it with the HTML one. What I'd really like is to keep the php while adding (not replacing) html editor tools.
This is known limitation of external editors for Visual Studio. Anyway according to PHP Tools features page (just updated), the work is in progress. For now, it isn't possible to 'mix' two languages like HTML & PHP.
Look at this thread:
http://support.devsense.com/viewtopic.php?f=21&t=987
Seems to come soon :-).
I'm using Eclipse Helios on MacOSX. I'm PHP guy so i just want all PHP relateed scripts to be shown as PHP code style. I mean Code Colors.
What i'm having is: i'm developing Drupal on that Eclipse. I just wanna see php files in Drupal .module .inc .install .. whatever in future, as PHP style.
For example:
If i even make my own file extensions like filename.abcd later on, how if i what that .abcd extension files appear as PHP code style with colors?
Currently all of these not previously registered extensions are showing as just Black Lines with no color. How to do?
You can configure file associations under Windows > Preferences.
And under General > Editors > File Associations.
Simply associate the extension with the PHP Editor and it should pick up syntax highlighting for you.
For more information see:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-13.htm
I am using Kepler and assigning the .module and .install file association did not work for me. (oddly enough, it did work for other extensions) What did work was going to help > install new software and installing the software located at this url: http://xtnd.us/downloads/eclipse
found here: http://drupal.cocomore.com/blog/using-eclipse-pdt-drupal-development
EDIT: To answer some of the comments - the file extension is .php, the perspective is PHP, and it is in a PHP project. I can't use different tools because this is a school project
I have Eclipse with Web Tools (so I can do web projects with JSP). I also have to use Eclipse for my PHP development (I am using it with XAMPP, if that matters). (Two different school projects.)
I have installed the plug in for PHP (in addition to XAMPP, which includes PHP itself) and it appears to work, in that I have a PHP perspective and can create a new PHP project. However, even when doing something as simple as the below, it doesn't work. Eclipse does not recognize the php tags at all.
Does anyone have any ideas what I'm missing?
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
You have to configure the "Content-types" in Eclipse, to associate the extension of your file with the PHP editor.
This can be done in Window > Preferences > General > Content Types > Text > PHP Content Type : here, you have to add the extension of the files that contain PHP code.
Here's a screenshot of what this looks like on my current installation :
(source: pascal-martin.fr)
If you want to use the PHP Editor for one specific file, without associating its extension with the PHP Editor, you can also right-click on the file's name, and choose the right editor in the Open With menu.
ok - on a whim I decided to look for menu options that might help. And I chose Project > Clean, which rebuilds from scratch. It suddenly works!
I don't know what happened, but apparently, it was an old error that I had fixed with the right plug-in info and I just needed the project to rebuild.
Thanks for the ideas, though!
Maybe change your current Eclipse perspective into PHP?
I believe Eclipse chooses the appropriate editor (and highlighter) based on the extension of the file you're editing. Try using .php or .phtml if you can.
I think you'd better use www.aptana.org for editing web pages. Aptana is really cool in this.
If you want to keep your existing Eclipse build you can also add Aptana as a Eclipse plugin or Aptana as a standalone as #FractalizeR has suggested.