Is there an equivilent of c#\'s #region in PHP?
Although this is an old thread, but if one is still interested one can set a shortcut to code folding in NetBeans. This answer extends @krtek 's answer. To achieve this follow the steps:
Go to Tools> Options> Editor> Code templates
Click New, enter "cf" as the abbreviation, then enter the following code as the expanded text:
// <editor-fold defaultstate="collapsed" desc=" ${DESCRIPTION} ">
${selection line}${cursor}
// </editor-fold>
Now, if you select multiple lines of text in the editor, you will get the "light bulb" icon in the margin. Click it, and you'll get the option "Surround with Code folding". Select it, enter a description and you're done.
For reference see this link: reference
K.I.S.S. solution:
{ // region name, description, etc.
code;
}
Or, comment above the brace... Braces don't need no function, man.
If you are using notepad++ you can define that sort of thing with the ide in user defined language dialog, and since good old region starts with the pound sign, it works great because the pound "#" is actually one way to mark in php a comment. But, I tried it in version 6.6.6 of notepad++ and it already has #region #endregion functionality already no need to do anything.