Pyrocms module or widget or plugin

て烟熏妆下的殇ゞ 提交于 2019-12-06 03:05:09

Any of those would work.

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

A Widget is just a self-contained intelligent partial. That means it takes a few options from the Control Panel for each instance and spits out a chunk of HTML.

A Plugin is just a tag. This tag is used in the template, pages, news, whatever and spits out a chunk of HTML too. A Plugin can have various methods in the class, each method will be a different tag.

I have actually made contact forms as all of these types of addon, but the one I have settled on for PyroCMS v1.1 is a modular plugin. This means there are views, models, etc for the module but we can skip the controller and just make a plugin like so.

That plugin matches up to the tag:

{pyro:contact:form}

That is because it is in the contact module and the method is form. See? :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!