CMS has a standard structure: website and admin panel. In the admin using the TinyMCE editor, the user (content manager) creates pages. Some pages should have different html-objects: (order form and send feedback, photo gallery and others). Naturally, such objects (plug-ins) should be created separately from the editor and then integrated into the page.
At the moment I have this implementation of the plug-in:
When creating, for example, a service order page , the user writes in the editor:
Дорогой вы наш пользователь! На этой странице вы можете сделать заказ услуги. {{order_service}} This text is stored in the database. When accessing the page, the Model responsible for displaying the pages of the site parses regularly the data from the database and, if there is a file of the same name, order_service.php enables it (require "order_service.php"). The code of this file generates the html order form of the service and inserts it instead of {{order_service}}. The resulting html-page with the form is displayed in the browser.
The order_service.php file also contains the processing code for the incoming post-data, makes queries to the database (singleton class), checks the data and places them in the database.
The question is, in fact, is such a technology correctly implemented in terms of MVC? After all, the processing of the form and access to the database is not done using the methods of the corresponding model, but directly in the code of the plugin itself. Are there more flexible options for implementing this kind of plug-ins?