does anyone know if there is a key combination for importing classes in Netbeans?
By pressing enter when I get the suggestions, the namespace is imported in the method like this:
public function index(\Illuminate\Http\Request){
What I want to achieve instead, is to add a line use Illuminate\Http\Request in the top of the file. How can I do this in netbeans? I have seen it in Phpstorm.
Also, another question a little off the topic, but I have seen people generating html5 code by typing html5 and with some key combination they generate a doctype, html, head and body. How can I do this?
For the first part
In newer versions of Netbeans , you can press Ctrl+Shift+I (Alt+Shift+I won't work as expected, though).
First, it searches for any smart or fully qualified instances in your file and then asks you of what types the found ones should be. It then adds fully qualified use statements to the top of your file and changes existing instances in the source to unqualified.
For the second part
You have to use a plugin called Emmet
Related
I tried setting up VS Code for a legacy PHP project, to evaluate it against other IDEs.
My problem is with the suggestions I get, when I press <an object>->Ctrl+Space.
For example I want to get all suggestions (properties and functions) of a certain class. I am in the class and I type:
$this->(Ctrl+Space)
I get a large list of functions and constants, which are things I can use in PHP in general and not the functions and properties of the class I am in. After I installed the PHP Intelephense extension, I get the class methods that I need in my suggestions, but still they are mixed with everything else and hard to find, unless I start typing the first letters of the function I need to access. To show you what I mean, this is what I get, when I type the following within a function of my class:
I don't think this is a matter of extension, because even if I disable all my extensions I still get the whole bunch of suggestions. How can I remove all unnecessary suggestions, or at least give priority to the class specific suggestions and see them on top of the list?
You must disable the vscode built-in PHP Language Features.
Click extensions.
In the search bar type #builtin php.
Click cog icon of PHP Language Features.
Click Disable.
I've been struggling with this for while too ...
You can just disable the basic PHP suggestions by setting php.suggest.basic to false in your settings.json file or use the settings UI at PHP > Suggest: Basic
With Intelephense installed everything works as expected now !
source : https://code.visualstudio.com/docs/languages/php#_disable-builtin-php-support
Is there a way (plugin?) for notepad++ to find a php resource in a complex project?
When I work in a project I can load the complete thing through the project window, fine. But when I have a file.php where there is a reference call for example
$this->param...
I would like to know what $this references, but if the class is defined in another file2.php, and both are called from a third file3.php I end up searching for ever. Any suggestions, or maybe an alternative if not possible in notepad++?
Maybe you can search for the param name (When searching, you can select to search trough all project or all opened files) ?
Also, you can use TagsJump plugin to jump to a definition. Install it by using PluginManager.
Another usefull plugin in SourceCookifier.
But as Mike 'Pomax' Kamermans said, notepadd++ is not an IDE and what you are asking is not possible.
How I can find and show all files in Phpstorm where this method
$this->other_model->any_method()
is called?
cmd+shift+f for Mac and ctrl+shift+f for Windows will find any piece of text throughout the project or directory. Or you could use alt+f7 to find usages.
PHPStorm Keyboard Mapping.
Viewing Structure of a Source File.
You can search for symbol with combination Ctrl+Shift+Alt+N. This combination allows you to search not only PHP classes/methods but also PHP variables, CSS classes etc.
If you want to find method usages in files:
click on your method and press Alt+F7
If you want to search any composition of your desire search, you can use from searching everywhere. I prefer to use this because PhpStorm makes it possible to look for any item of the source code, databases, actions, elements of the user interface, etc. in a single action.
to use that, only press search button in the right upper corner of phpStorm or 2 times press shift key on your keyboard. Now you can find your search everywhere. This is great functionality of phpStorm.
To read more information about using this search method, go to the following link:
Searching Everywhere
To See all the methods for search in phpStorm, Go to the following link:Searching Through the Source Code
I am using the php form builder class (http://www.imavex.com/pfbc3.x-php5/examples/html5.php)
and jqbootstrapvalidation (http://reactiveraven.github.io/jqBootstrapValidation/)
So far I can succesfully combine these (even using some of the patterns php form builder class already built in) and I edited some of the element php files to change a pattern here and there, and to add some \n's to make a readable source code. (I still don't like my entire form on a single line in the source..)
But I would like to use different colours for the bootstrap. I've tried downloading several themed bootstrap.min.css files using paintstrapand twitter bootstrap themeroller
However, as soon as I include these instead of the standard netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css file, all my styling is lost and it looks the same as if there was no stylesheet included.
Since the php form builder class is relatively old, do I need to change all it's code to become compatible with the newer bootstrap, or is there a faster way to do this (perhaps a different form builder?)? Or am I messing up something else that is causing this change style options?
Appearantly there are a few changes need to make to fix this:
https://code.google.com/p/php-form-builder-class/issues/detail?id=205
allthough it is not "full-on" bootstrap 3.0. Also, the jqueryvalidator needs some adaptation to work with bootstrap 3.0. I'm currently busy making everything work the way I like it, adding glyphicons for the forms (optionally) etcetera. I'll get back to you as soon as I am finished and drop the code of somewhere for all the lovely people to enjoy or shout at.
I did'nt want to use imavex class for several reasons :
wanted a class witch could be easily updated if Bootstrap's version changed
wanted to have more control on generated code (add or remove wrappers, class, attributes, ...)
wanted to generate separate code for css/js includes/js code
wanted to be able to configure any jquery plugin with it
So I made my own (not free but only 5$), you can see the demo and complete doc here : http://codecanyon.net/item/php-form-class-for-bootstrap/8790160?WT.ac=category_thumb&WT.z_author=migli
Hope it helps and hope you'll like it
I have the following ide's for php
Dreamweaver
php-Eclipse
Textpad
I wish to jump to a function's definition which is located in another file which is not yet open. How could I do that. I am studying a websites code and have the entire directory structure in my local root folder. I come across certain functions and I don't know in which file their definition is. Please suggest something.
In eclipse PDT IDE put mouse over class name, property, method or function name (must be in opened eclipse project) and press CTRL + clic.
It work with almost all declarations, even constants and class constants. In most case it will work, but it can have trouble with some dynamic property assignement like magic methods or certain injected dependency.
The file will be opened, and if target is in same file code view will scroll to the declaration
Press F3 in eclipse and you will find the declaration.
To jump to function definition for Dreamweaver just add this extension:
http://code.google.com/p/dwoop/.
Also you can add Autocomplete feature to Dreamweaver by going to Site --> Site Specific code hints --> select a folder which you want to scan for autocomplete --> save it with any custom name you want.
This works with any type of project (wordpress, codeigniter...)
I wish to jump to a function's
definition which is located in another
file which is not yet open.
I can suggest you about dreamweaver, the one i use. Point the cursor at the file that is included via php's include, require, etc or within link's href and src attribute and press Cntr+D and that file should open.
For functions, just right click anywhere on the document, in the context menu you should see the Functions link about all functions defined in the document.
phpDesigner can do that
In an opposite direction, and perhaps out of question's field, but if your code if OOP and you want to study it you can try automated tools to get UML view of its architecture , but these softwares are generally not free.
I found a way of going to the function definition. Using help in dreamweaver and selecting the option of searching wihtin a folder type 'function function_name()' and unselect all the checkboxes below.
if you press find it will start opening pages which containg the expression or find all will not open any pages but show the list of all the pages in the bottom panel.
Well, I'm currently working with Dreamweaver CC. If you want to jump to Function Definition from code, just select the desired function and then right click -> then select "Find Selection" option or you can use "Shift+F3", and you will be redirected to the code where the function is defined. enter image description here