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 ;)
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
First let me say I've never used PHP but I'm looking to learn it, so my question is this how do you use PHP within Visual Studio Ultimate? is it similar to how you declare JQuery i.e
$(document).ready(function ()
{
// Code goes here?
});
I've done multiple searches on Google, but I don't get the answer I'm looking for.
Or do I need a complete different bit of software to use it?
By default VS is not made to run PHP, but you can do it with extensions:
You can install an add-on with the extension manager, PHP Tools for Visual Studio.
If you want to install it inside VS, go to Tools > Extension Manager > Online Gallery > Search for PHP where you will find PHP Tools (the link above) for Visual Studio. Also you have VS.Php for Visual Studio. Both are not free.
You have also a cool PHP compiler called Phalanger:
If I'm not mistaken, the code you wrote above is JavaScript (jQuery) and not PHP.
If you want cool standalone IDE's for PHP: (Free)
Netbeans: https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=php
Eclipse: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr
Maybe we should help you with a big misunderstanding on your side first: PHP is (like ASP.NET or whatever you used to far) a server side language while javascript is client side.
This means that PHP will run on your webserver and create a HTML page dynamically which is then sent to the browser. Javascript in turn is embedded (either directly or as a referenced file) into this HTML page and runs in the browser.
Maybe you can now understand why your approach so far could never work out.
Try Visual Studio Code. Very good support for PHP and other languages directly or via extensions.
It can not replace power of Visual Studio but it is powerful addition to Visual Studio.
And you can run it on all OS (Windows, Linux, Mac...).
https://code.visualstudio.com/
Maybe it's possible to debug PHP on Visual Studio, but it's simpler and more logical to use Eclipse PDT or Netbeans IDE for your PHP projects, aside from Visual Studio if you need to use both technologies from two different vendors.
Here are some options:
Visual Studio PHP (VS.Php).
PHP Tools for Visual Studio by DEVSENSE.
Or you can check this list of PHP editor reviews.
I don't understand how other answers don't answer the original question about how to use PHP (not very consistent with the title).
PHP files or PHP code embedded in HTML code start always with the tag <?php and ends with ?>.
You can embed PHP code inside HTML like this (you have to save the file using .php extension to let PHP server recognize and process it, ie: index.php):
<body>
<?php echo "<div>Hello World!</div>" ?>
</body>
or you can use a whole php file, ie: test.php:
<?php
$mycontent = "Hello World!";
echo "<div>$mycontent</div>";
?> // is not mandatory to put this at the end of the file
there's no document.ready in PHP, the scripts are processed when they are invoked from the browser or from another PHP file.
I downloaded eclipse for PHP and while code hinting works for most of PHP, their is none for just HTML. How can I fix that?
Eclipse for PHP is no longer supported (clickity click), so even if you find a way to do this it will not be supported anymore.
The Aptana plugin for Eclipse has great PHP and HTML assistance and I recommend it highly:
http://www.aptana.com/
Dreamweaver has been my favourite IDE for programming PHP for a while.
However we have recently updated our servers to work with php 5.3.x
Now everytime I use php 5.3 specific tags like namespace dreamweaver suggests that there is a syntax error.
I would like to be able to add the namespace as a valid tag or install a plugin which does that for me. If that can't be done it would be best if I could just disable the checking for errors.
Can anyone help me out?
Thanks in advance!
Dreamweaver CS5 PHP support is limited to PHP 5.2 (based on a couple of Google searches), and the syntax checker is not extensible, so no extension would be able to make that go away. I've seen in a couple of places that you can turn off the error checking by turning off the PHP related code hints (Edit [Dreamweaver on Mac] -> Preferences -> Code Hints), but I've not tried that. Of course, if that works, then you'll get no code hints for variables and functions defined in your code, so not sure that will be a good trade off. On the other hand, Dreamweaver does report that code hinting may not work until syntax errors are corrected.
Dreamweaver CS5.5 Dynamic Code HInting PHP support is updated to PHP 5.3
How to get code completion to work for PHP in Netbeans 6.9.1?
I want Netbeans to suggest native PHP functions.
EDIT:
The auto complete only works for reserved vars and reserved keywords but not for native functions. Looking at the example above, it should suggest e.g str_replace, strlen, etc...that doesnt happen even after CTRL + SPC.
Just make sure you have enabled the PHP plugin, that should do the trick. BTW autocomplete might not work while NetBeans is checking for project changes though...
This happened to me from time to time when I used NetBeans. I used the CTRL+SPACE shortcut to invoke the code completion window.
UPDATE:
If you're interested, you can also use VIM, which has a code completion feature for php as well.
Assuming you have VIM 7 (Full version) installed, add the following to your .vimrc file:
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
To use the code completion window, simply use CTRL+X CTRL+O
Install NetBeans with PHP support. OR if you already have netbeans, you need to install PHP plugin by going to Plugins Manager.
If you want code completion for external libraries like Zend, add them in the Gobal Include Path (available in project properties)
Apparently deleting the contents of .netbeans/var/cache/index in your user directory (application data on windows etc) fixed it.