zantknight/yii2-cam-capture
最新稳定版本:v1.0.0
Composer 安装命令:
composer require zantknight/yii2-cam-capture
包简介
This extension is HTML5 Media Capture, integrating with yii2-gallery4
关键字:
README 文档
README
This extension is HTML5 Media Capture, integrating with yii2-gallery4
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist zantknight/yii2-cam-capture "*"
or add
"zantknight/yii2-cam-capture": "*"
to the require section of your composer.json file.
Usage
Note: Working on with yii2-bootstrap4 only, to shift onto bootstrap4, follow this instruction
- If you have not migrate gallery4 yet, simply execute migration by calling this command
php yii migrate --migrationPath=@vendor/zantknight/yii2-gallery4/migrations - Update config/web.php
return [ ... 'modules' => [ 'gallery4' => [ 'class' => 'zantknight\yii\gallery\Module', ], ] ]
- Put this chunk in params.php
return [ ... 'bsVersion' => '4.x', ... ];
- Add this behavior to your model
... use zantknight\yii\capture\CamCaptureBehavior; class YourModel extends \yii\db\ActiveRecord { ... public function behaviors() { return [ ... [ 'class' => CamCaptureBehavior::className(), 'model' => $this, 'fieldName' => 'name' ] ... ]; } }
- fieldName = which field you want to add as picture filename
- Put this widget into your view
<?= \zantknight\yii\capture\CamCaptureWidget::widget([ 'ownerModel' => $model ]); ?>
- Make a folder "media" under @web
- Viola
Screenshots
统计信息
- 总下载量: 279
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-05