simialbi / yii2-kanban
yii2 的看板模块
2.3.0
2022-02-09 11:00 UTC
Requires
- php: >=5.6
- arogachev/yii2-sortable: ^0.1.6
- bower-asset/fullcalendar: 4.2.*
- fortawesome/font-awesome: ^5.12.0
- kartik-v/yii2-widget-fileinput: ^1.0.9
- npm-asset/highlight.js: ^9.18.1
- npm-asset/swiper: ^6.3.5
- rmrevin/yii2-fontawesome: ^3.4.0
- simialbi/yii2-simialbi-base: >=0.10.2 <1.0 | ^1.0.0
- simialbi/yii2-summernote: ^1.1.0
- simialbi/yii2-widget-chart: ^0.7.0
- simialbi/yii2-widget-datedropper: ^1.0.0
- simialbi/yii2-widget-hideseek: ^1.0.0
- simialbi/yii2-widget-turbo: ^1.0.0
- simshaun/recurr: ^5.0.0
- yiisoft/yii2: ^2.0.20
- yiisoft/yii2-bootstrap4: ^2.0.4
Requires (Dev)
- ext-gd: *
- ext-mbstring: *
- phpunit/phpunit: <7
- simialbi/yii2-ticket: ~1.0@dev
- yiisoft/yii2-coding-standards: ~2.0
Suggests
- ext-gd: For autogeneration of visualisations
- ext-mbstring: For encoding conversion
- 2.3.0
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- dev-master / 2.0.x-dev
- 2.0.1
- 2.0.0
- 1.10.1
- 1.10.0
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.10
- 1.8.9
- 1.8.8
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0
This package is auto-updated.
Last update: 2024-09-12 09:57:14 UTC
README
资源
安装
安装此扩展的首选方法是使用 composer。
运行以下命令
$ php composer.phar require --prefer-dist simialbi/yii2-kanban
或者在您的 composer.json
文件的 require
部分添加
"simialbi/yii2-kanban": "^2.0.0"
to
。
使用方法
为了使用此模块,您需要
- 配置模块 以使模块可用。
- 创建一个扩展 UserInterface 的用户身份 类
配置模块
在您的 Yii 配置文件的模块部分配置模块。
'modules' => [ 'kanban' => [ 'class' => 'simialbi\yii2\kanban\Module', //'statuses' => [], //'statusColors' => [], //'on boardCreated' => function ($event) {}, //[...] ] ]
参数
注意:如果未定义,将自动定义状态
Task::STATUS_NOT_BEGUN
、Task::STATUS_DONE
和TASK::STATUS_LATE
。
事件
设置控制台配置并应用迁移
使用以下命令应用迁移: yii migrate --migration-namespaces='simialbi\yii2\kanban\migrations'
或配置您的控制台如下
[ 'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationNamespaces' => [ 'simialbi\yii2\kanban\migrations' ] ] ] ]
然后应用 yii migrate
命令。
创建身份
创建一个实现 simialbi\yii2\models\UserInterface
的身份类,例如。
<?php use yii\db\ActiveRecord; use simialbi\yii2\models\UserInterface; class User extends ActiveRecord implements UserInterface { /** * {@inheritDoc} */ public static function tableName() { return 'user'; } /** * {@inheritDoc} */ public static function findIdentity($id) { return static::findOne($id); } /** * {@inheritDoc} */ public static function findIdentityByAccessToken($token, $type = null) { return static::findOne(['access_token' => $token]); } /** * {@inheritDoc} */ public function getId() { return $this->id; } /** * {@inheritDoc} */ public function getAuthKey() { return $this->auth_key; } /** * {@inheritDoc} */ public function validateAuthKey($authKey) { return $this->getAuthKey() === $authKey; } /** * {@inheritDoc} */ public function getImage() { return $this->image; } /** * {@inheritDoc} */ public function getName() { return trim($this->first_name . ' ' . $this->last_name); } /** * {@inheritDoc} */ public function getEmail() { return $this->email; } /** * {@inheritDoc} */ public function getMobile() { return $this->mobile; } /** * {@inheritDoc} */ public static function findIdentities() { return static::find()->all(); } }
创建此类后,在您的应用程序配置中将它定义为身份类
'components' => [ 'user' => [ 'identityClass' => 'app\models\User' ] ]
配置 jQuery UI(可选)
如果您在您的应用程序的其他地方没有使用 jQuery UI,您可以仅通过加载所需的脚本来减少加载量
'components' => [ 'assetManager' => [ 'bundles' => [ 'yii\jui\JuiAsset' => [ 'css' => [], 'js' => [ 'ui/data.js', 'ui/scroll-parent.js', 'ui/widget.js', 'ui/widgets/mouse.js', 'ui/widgets/sortable.js', ], 'publishOptions' => [ 'only' => [ 'ui/*', 'ui/widgets/*' ] ] ] ] ] ]
注意:如果您使用完整的 jQuery UI 包,此模块使用的 bootstrap tooltip 将被 jui tooltip 覆盖
示例用法
现在您可以通过导航到 /kanban
访问看板模块。
注意:某些操作只能由认证(登录)用户执行,例如创建看板、桶等。
许可证
yii2-kanban 在 MIT 许可证下发布。有关详细信息,请参阅捆绑的 LICENSE。