malankateam/yii2-components

为 Yii 框架提供的额外组件

安装: 132

依赖者: 3

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 1

类型:yii2-extension

v0.1.1 2017-10-18 18:46 UTC

This package is auto-updated.

Last update: 2024-08-29 04:20:07 UTC


README

MALANKA Logo

额外组件模块

为 Yii2 框架提供的额外组件。

该模块的主要目的是提供封装 PHP 和 Yii2 框架中常见功能的能力。

安装

要安装模块,需要 Composer

composer require malankateam/yii2-components:~0.1.0

配置

将 composer.json 添加到您的项目中后,您需要创建迁移并更新迁移文件到

use robot72\components\helpers\MigrationHelper;

class m000000_092100_our_migration extends MigrationHelper
{
    public $tableName = '{{%lead_generate}}';

    public function up()
    {
        $this->setTableOptions();
        $this->createTable($this->tableName, [
            'id' => $this->primaryKey(),
            'type' => $this->integer(11),
            'data' => $this->text(),
            'create_at' => $this->timestamp()->notNull(),
        ], $this->tableOptions);
    }

    public function down()
    {
        $this->dropTable($this->tableName);
    }
}