承接 atellitech/utils-yii2 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

atellitech/utils-yii2

最新稳定版本:1.4.2

Composer 安装命令:

composer require atellitech/utils-yii2

包简介

Utilities for Yii2

README 文档

README

The utilities for Yii2

Getting Start

Requirements

  • php8.0+

Install

$ /lib/path/composer require atellitech/utils-yii2

Model Generator

This generator is used to create model class by particular table name.

Getting Start

Add controllerMap into config file of console.

...
"controllerMap": [
    'genmodel' => [
        'class' => 'AtelliTech\Yii2\Utils\ModelGeneratorController',
        'db' => 'db', // db comopnent id default: db
        'path' => '@app/models', // store path of model class file default: @app/models
        'namespace' => 'app\models', // namespace of model class default: app\models
    ],
]

Usage

$ /path/to/yii genmodel {tableName} --option=value...

Options

  • db Database component id
  • path Store path of model class file
  • ns Namespace of model class

Module Generator

This genertor is used to create related files of API module by name that will create files into @app/modules/{name}.

Getting Start

Add controllerMap into config file of console.

...
"controllerMap": [
    'genapi' => [
        'class' => 'AtelliTech\Yii2\Utils\ApiGeneratorController',
        'db' => 'db' // db comopnent id default: db
    ],
]

Usage

$ /path/to/yii genapi/generate-module --name={moduleName}

API Generator

This genertor is used to create an API controller file into specific module name by particular table name.

Getting Start

Add controllerMap into config file of console.

...
"controllerMap": [
    'genapi' => [
        'class' => 'AtelliTech\Yii2\Utils\ApiGeneratorController',
        'db' => 'db' // db comopnent id default: db
    ],
]

Usage

$ /path/to/yii genapi {tableName} --option=value

Options

  • name Name of module

Container definition Dumper

Dump service and repository files to definitions of container file

Getting Start

Add controllerMap into config file of console.

...
"controllerMap": [
    'container' => [
        'class' => 'AtelliTech\Yii2\Utils\ContainerController'
    ],
]

Usage

$ /path/to/yii container/definitions --srcPath={srcPath} --destPath={destPath} --srcNs={srcNs} --suffix={suffix}

JsonFileLogTarge

Support exporting log in JSON.

Note: this class is extending yii\log\FileTarget

Getting Start

Add to config file

...
'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'AtelliTech\Yii2\Utils\Log\JsonFileLogTarget',
                'levels' => ['error', 'warning'],
                'logFile' => '@app/runtime/logs/web.log',
            ],
        ],
    ],

统计信息

  • 总下载量: 1.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-29