Good day! I asked two questions on the implementation of certain functions. I can not decide how to create them correctly - as a component, or as a widget, or as a separate class. More details below.
- How best to create additional support functions that can be used in different controllers?
Example:
We have an alert() function that is responsible for recording alerts (writing to the database for later output) about some events that may be in different controllers (k) / models (m). For example: a new user has registered (K: UserController, M: User), a comment has been left in the blog (K: BlogController, M: Article).
How best to implement this? In the form of a component? Or just create any independent separate class?
- How best to implement the output of meta-data, the connection of third-party modules?
Example:
Suppose we have 2 tables in the database: 1 - with which we need to output meta-data for certain actions. 2 - with which you need to display third-party scripts (for example, jivo-chat, metrics, etc.) that the user manages in the control panel.
How best to implement? In essence, widgets are used for the HTML presentation, right?