startpl/t2cms-module

The module example for t2cms

Installs: 7

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:t2cms-module

1.0.0 2020-04-14 10:38 UTC

This package is auto-updated.

Last update: 2024-10-15 20:10:37 UTC


README

You can use this module as template

Module development features

File structure:

my-module
├─ backend
|  ├── Module.php
|  └── config
|      └── main.php 
├── frontend
|   ├── Module.php
|   └── config
|       └── main.php 
├── common
|   ├── Module.php
|   └── config
|       └── main.php 
├── module_info.php
└── ModuleInstall.php

Each part of your module (backend/frontend/common) is a regular yii2 module.

All parts are optional, you can only implement a backend or frontend, or only a common.

if you use composer:

  • Your composer.json must contain type: "t2cms-module"

File Descriptions

module_info.php

<?php
return [
    'url'         => 'example-module', // module url
    'namespace'   => 'startpl\\t2cms\\moduleExample',
    'name'        => 'example module',
    'description' => 'The module example',
    'version'     => '1.0.0',
    'fa_icon'     => 'envelope', // fontawesome
    'author'      => 'Your Name'
];

ModuleInstall.php

ModuleInstall class must implement [t2cms\module\interfaces\IModuleInstall] interface

and must contain follow methods:

  • install(): bool
  • uninstall(): bool
  • activate(): bool
  • deactivate(): bool
  • update(): bool