A
A
Anton2016-07-12 01:48:57
Yii
Anton, 2016-07-12 01:48:57

What are modules for?

I would like to hear why to use modules and in what cases it is necessary to use modules?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AlikDex, 2016-07-12
@AlikDex

Modular programming is the organization of a program as a collection of small independent blocks called modules, the structure and behavior of which obey certain rules.[1] The use of modular programming makes it easier to test the program and find errors. Hardware-dependent subtasks can be strictly separated from other subtasks, which improves the portability of the created programs.
A module is a functionally complete fragment of a program. In many languages ​​(but by no means necessarily) it is issued as a separate file with source code or a named continuous part of it. Some languages ​​provide for combining modules into packages.

reference
And means so and should be used. For example, a block of comments deserves to become a module. Because it only needs to know the IDs of the entities it is called on. Such a module can be used for anything. For example, comment on articles, photos, videos and all that stuff. Which in turn can also be separate modules =)

P
Paulus, 2016-07-12
@ppokrovsky

I think that the question here is not about the definition of modularity in general, but about modularity in the context of Yii.
In Yii, a module is a mini-application that has its own models, controllers, and views. A module cannot exist on its own, only in the context of an application. Modules inherit from yii\base\Module. An example of a module is the admin panel for the CMS.
Here it is well written about it
https://yiiframework.com.ua/en/doc/guide/2/structu...

A
Alexander Makarov, 2016-07-13
@SamDark

rmcreative.ru/blog/post/moduli-yii

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question