Classes, libraries, interfaces (APIs), functions, these concepts are defined according to the size of the problem size. A small problem is definitely not necessary to write a library, just a few words.
But for example, a login verification, this feature is very powerful, very general, may need to use the front office,
Then write a mall, login controller, Shopping Hall controller, shopping cart controller, usually after the shopping cart controller view products, directly back to the shopping Hall controller display product list, this time do not need to go to the login controller
This is the shopping hall controller and the shopping Cart controller work together, but in fact, the general situation of all controllers need to inherit a basecontroller, and then in the Basecontroller to verify that there is no session, so
You can verify that the user has no login, so that security is guaranteed, for login This controller need not inherit this basecontroller, so I passed the analysis that it is necessary to inherit better, because this can verify the session
When the user enters the login path in the address bar, the user is required to reenter the user name password, or the user needs to enter it again.
PHP API and Login permissions validation