Common MVC Issues - Naming, Structure (PHP)

I tried many PHP MVC frameworks and I noticed that in many frameworks you can do things like this:

$this->security->encodeForHTML();

So basically there is a Security class that contains the encodeForHTML () method. Isn't that a safety class? Is there a specific name for this type of "inner" singleton class?

Since there are other classes that are not single:

$form = new Form;

In this case, you can create as many shapes as you want. I understand the essence of this, it clearly does not make sense to initialize many security classes, but I wonder if there are names for these classes (except single and non-single)? One guy suggested using the words “plugins” for classes that can be created, and “libraries” for those that are built into the structure. It makes sense?

Thanks for your reply!

+3
source share
2 answers

MVC/ /, singleton/non-singleton ( / , )

. Zend .

- . - /, / . , , , , , , API , - .

+4

, " " .

IMO, , MVC . , CodeIgniter : . , , , .

+1

Source: https://habr.com/ru/post/1710092/


All Articles