Pyrocms module or widget or plugin

It drives me crazy! I want to include a simple contact form on the home page of the site. I cannot work if I need to create a module, widget or plugin. None of them seem to be right! Modules work only as stand-alone pages, for example, an existing contact module. Widgets seem to display data (derived from db or some kind of feed, like Twitter), and the plugin seems to look like a library class. I like the module the most. I need a controller (to display the correct presentation and processing of data from the form and views, it depends on whether the form was submitted or not. My problem is that I can’t figure out how to enable the module as a section of the page (also as for the widget) instead of your own page.

+3
source share
1 answer

Any of them will work.

The module is an MVC triad that can interact with a URL, display views, have its own models, helpers, config, etc. The module is full meat and two-veg.

A widget is just an autonomous intelligent partial. This means that for each instance, it requires several options from the control panel and rips out a piece of HTML.

A plugin is just a tag. This tag is used in the template, pages, news, anything and splashes out a piece of HTML. A plugin can have different methods in a class, each method will be a different tag.

, , PyroCMS v1.1, - . , , .., .

:

{pyro:contact:form}

, , . ?:)

+7

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


All Articles