PHP #region for code folding?

前端 未结 15 1602
星月不相逢
星月不相逢 2021-01-31 14:06

Is there an equivilent of c#\'s #region in PHP?

15条回答
  •  Happy的楠姐
    2021-01-31 15:01

    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:

    1. Go to Tools> Options> Editor> Code templates

    2. Click New, enter "cf" as the abbreviation, then enter the following code as the expanded text:

         // 
            ${selection line}${cursor}
            // 
    
    1. In the description tab, enter "Code folding", and click Ok.

    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

提交回复
热议问题