buildinteractivebusiness/yii2-components

Yii 框架的附加组件

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

This package is not auto-updated.

Last update: 2024-09-22 14:36:57 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);
    }
}