Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Storefront extends Plugin
- {
- public static $plugin;
- public $schemaVersion = '1.0.1';
- public $hasCpSettings = true;
- public function init()
- {
- parent::init();
- self::$plugin = $this;
- $this->setComponents([
- 'tracking' => TrackingService::class,
- ]);
- Event::on(
- Plugins::class,
- Plugins::EVENT_AFTER_INSTALL_PLUGIN,
- function (PluginEvent $event) {
- if ($event->plugin === $this) {
- }
- }
- );
- Craft::info(
- Craft::t(
- 'storefront',
- '{name} plugin loaded',
- ['name' => $this->name]
- ),
- __METHOD__
- );
- }
- public function hasCpSection()
- {
- return false;
- }
- public function hasSettings()
- {
- return true;
- }
- protected function createSettingsModel()
- {
- return new Settings();
- }
- protected function settingsHtml(): string
- {
- return Craft::$app->view->renderTemplate('storefront/settings',
- [
- 'settings' => $this->getSettings()
- ]
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement