-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAvatarUploadWidget.php
51 lines (44 loc) · 1.14 KB
/
AvatarUploadWidget.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace daimakuai\avatar;
/**
* @see 代码块中文网 http://www.daimakuai.com
* @author yt <[email protected]>
* 设置挂件
* 如何配置请到官网(代码块中文网:www.daimakuai.com)查看相关文章
*/
use Yii;
use yii\bootstrap\Widget;
use daimakuai\avatar\assets\AvatarAsset;
use yii\base\Object;
use yii\helpers\Html;
use yii\widgets\InputWidget;
use yii\web\View;
class AvatarUploadWidget extends Widget
{
public $options = ['class' => 'form-control'];
public $imageOptions = [];
public $inForm = false;
public $imageUrl = '';
public $setTarget = '';
public $model;
public $type = 'hidden';
public $attribute = [];
public $attributes = [];
public $view ;
public function run()
{
parent::init();
$this->registerClientScript();
}
public function registerClientScript()
{
AvatarAsset::register($this->view);
//$script = "";
//$this->view->registerJs($script,View::POS_READY);
}
public function setFooter()
{
$model = new UploadForm();
return $this->render('upload', ['model' => $model]);
}
}