Using region (code folding) in PHPStorm


People who use VS to write C# are very fond of it.#regionImplementation of the code folding function. PHP itself does not have similar functions, but as a PHPer, it is certainly unwilling to show weakness in this regard. This article describes the use of the most powerful PHP IDE in history – PHPStorm to achieve code folding (note: not necessarily a function or a class).

As a matter of fact, there are only three lines in the text, with all the nonsense said before.

//region description

Someone wants to say you don’t have a picture. You say Smartisan. Okay, I’ll put up a picture.

  1. Expansion effect map:

Expansion diagram

  1. Folding effect map:

Folding diagram

Note: Only valid under PHPStorm. Of course, it supports not only PHP code, but also JS code.

Original address

Recommended Today

The method of obtaining the resolution of display by pyqt5

The code is as follows import sys from PyQt5.QtWidgets import QApplication, QWidget class Example(QWidget): def __init__(self): super().__init__() self.initUI() #Interface drawing to initui method def initUI(self): self.desktop = QApplication.desktop() #Get display resolution size self.screenRect = self.desktop.screenGeometry() self.height = self.screenRect.height() self.width = self.screenRect.width() print(self.height) print(self.width) #Show window if __name__ == ‘__main__’: #Create applications and objects app […]