galonskiy / yii2-codebuffer
CodeBuffer - 描述
0.0.1
2018-03-18 15:17 UTC
Requires
- php: >=7.1.0
- yiisoft/yii2: ~2.0.0
This package is not auto-updated.
Last update: 2024-09-29 04:43:02 UTC
README
此扩展是为Yii框架2.0开发的。
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一:
composer require galonskiy/yii2-codebuffer "*"
或
"galonskiy/yii2-codebuffer": "*"
将以下内容添加到您的composer.json
文件的require部分:
在继续之前,您需要创建数据库中的这些表。
php yii migrate --migrationPath=@vendor/galonskiy/yii2-codebuffer/migrations
作为组件使用
扩展安装后,只需将其粘贴到您的配置文件中,并通过以下方式在代码中使用它:
... 'components' => [ ... 'codebuffer' => [ 'class' => '\galonskiy\codebuffer\CodeBuffer' ] ... ] ...
使用
... Yii::$app->codebuffer->generate('XXX', 'XXX'); ...
作为类使用
在代码中使用它
... (new \galonskiy\codebuffer\CodeBuffer)->generate('XXX', 'XXX'); ...