zacksleo/yii2-wechat

Yii2 wechat module

Installs: 1 097

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 3

Forks: 0

Open Issues: 1

Language:CSS

Type:yii2-extension

3.1.5 2019-07-01 12:37 UTC

This package is auto-updated.

Last update: 2024-10-29 03:43:14 UTC


README

Latest Stable Version Total Downloads License

准备工作

首先配置 yii2-easy-wechat

配置模块依赖

注意 layout和layoutPath写实际使用的布局文件, 文件内容参考 src/layouts

配置 component

'components' => [

   'settings' => [
        'class' => 'pheme\settings\components\Settings',
    ],
]

配置 modules

'modules' => [

    'settings' => [
       'class' => 'pheme\settings\Module',
    ],
    'treemanager' => [
          'class' => 'kartik\tree\Module',
      ],
    'wechat' => [
        'class' => 'zacksleo\yii2\wechat\backend\Module',
    ],
]

安装

composer require zacksleo\yii2-wechat --prefer-dist

数据库迁移

配置数据库迁移

对于高级模板(yii2-app-advanced), 配置 console/config/main.php 文件:

    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationPath' => [
                '@console/migrations/',
                '@pheme/settings/migrations',
                '@zacksleo/yii2/wechat/migrations'
            ],
        ],
    ],

对于基础模板 (yii2-app-basic), 配置 config/console.php 文件:

    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationPath' => [
                '@app/migrations/',
                '@pheme/settings/migrations',
                '@zacksleo/yii2/wechat/migrations'
            ],
        ],
    ],

执行迁移

yii migrate/up