Plugins
Programming plugins is the essential part of Surikata.io's backend programming. This is where all your backend functionality is implemented.
You can:
- customize the website design (the frontend):
- dynamicaly create a full-featured SEO-friendly routing table for your site
- prepare variable values for the TWIG renderer
- render non-html pages like sitemap.xml or similar
- customize the administration panel (the backend):
- extend or modify database structure of you e-commerce site
- extend or modify UI of the administration panel
- implement cron functionality
- create various imports or exports
There is a lot more to do with plugins. Have fun!
Introduction
Create your first plugin (5-minute HelloWorld example)
Folder structure
Default plugins
In the overall class hierarchy, plugins are located here:
Diagram generated by www.nomnoml.com
Note that there are two paths: one for the customization of the administration panel (the AdminPanel) and the second for the website content rendering (the Web).
For the administration panel, there is a \ADIOS\Core\Plugin class in the middle which implements basic functionality for the rich web application based on ADIOS framework (in our case - the administration panel). Surikata then implements some extended functionality in \Surikata\Core\AdminPanel\Plugin class.
On the other hand, the plugin rendering mechanism for the website's frontend is implemented directly in Surikata's core (the \Surikata\Core\Web\Plugin class).
Frontend (the website design)
Class declaration
TO BE EXPLAINED: class, extend, namespace, most used methods
Sitemap (routing table)
Generate SEO friendly URLs
Configure routing table and extract variables from URL
Rendering
TO BE EXPLAINED: renderTwigParams
Backend (the administration panel)
Class declaration
TO BE EXPLAINED: class, extend, namespace, most used methods
Events
TO BE EXPLAINED: dispatchEventToPlugins, list of events, examples
Administration panel UI
TO BE EXPLAINED: Sidebar integration, Actions & content rendering
Actions
TO BE EXPLAINED: render, renderJSON
Each plugin can implement own actions to customize the UI of the administration panel.
Models
Each plugin can extend the overall database structure of the e-commerce site by implementing own models.