定制 zantknight/yii2-cam-capture 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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

  1. If you have not migrate gallery4 yet, simply execute migration by calling this command
    php yii migrate --migrationPath=@vendor/zantknight/yii2-gallery4/migrations
    
  2. Update config/web.php
    return [
        ...
        'modules' => [
            'gallery4' => [
                 'class' => 'zantknight\yii\gallery\Module',
             ],
        ]
    ]
  3. Put this chunk in params.php
     return [
         ...
         'bsVersion' => '4.x',
         ...
     ];
  4. 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
  5. Put this widget into your view
    <?= \zantknight\yii\capture\CamCaptureWidget::widget([
        'ownerModel' => $model
    ]); ?>
  6. Make a folder "media" under @web
  7. Viola

Screenshots

  • Widget Widget UI
  • Pop-up Capture Pop-up Capture
  • Image Captured to widget Pop-up Capture

统计信息

  • 总下载量: 279
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固