Macros and Advanced Entry Code Templates !
Templates with parameterized code (try entering fnc in netbeans and then immediately pressing Tab, and then continuing to press Tab to find out what happens, how it cycles through the function name and function parameters - look inside the code code to see how it done). (Options> Editor> Code Templates)
Some simple examples (I made some of them, some of them have netbeans):
- [forek] expands to: [foreach ($ array as $ key => $ value) {}] (This code comes with netbeans, the rest I did)
- [arr] + Tab expands to: [array ();]
- [kv] + Tab expands to: ['key' => "val",] (the key and val are parameters that I can cycle through and edit using the tab. The code template looks like this: ['$ {key}' => "$ {val}",] where [$ {something}] is a template parameter, it prints [something]. If you want tio print [$ something], I think you need to use three] $ ] characters: [$$$ {key}])
EDIT: You can create a code template for an arrow with a single letter (for example, "m" for ex), but when you enter the code, you must put a space before the letter, otherwise it will not recognize it. Example: $ obj m [press Tab], expanding to [$ obj β]. The space between them works fine and is not a syntax error. / EDIT
Every time I want, there is a template for something, I actually insert the template, and then use it right away and continue with the rest of the php programming.
Macros with shortcuts as mini code templates ! (Netbeans> Menu> Edit> Start / Stop Macro)
The Best Macros I made for php actually code templates (because "+ Tab does not work as a code template for some reason, only if the template starts with the letter in which it works) ([shortcuts] inserts [text]):
- the shortcut [Ctrl +;] inserts [->] (no more than a keyboard gymnastics, no more than a point sintax envy in other languages ββ:))
- shortcut [Ctrl + Shift +;] inserts [=>]
snrp Jul 23 2018-10-23T00: 00Z
source share