-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputWidget.php
43 lines (36 loc) · 953 Bytes
/
InputWidget.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
<?php
namespace common\listen\widgets\Uploadpictures;
use yii\helpers\Html;
class InputWidget extends \yii\widgets\InputWidget
{
/**
* @var string 按钮上面的名称
*/
public $title = '上传图片';
public $class = '';
/**
* 初始化
*/
public function init()
{
// echo Html::getAttributeValue($this->model, $this->attribute);
parent::init();
}
public function run()
{
// 获取字段的值
$attributeValue = Html::getAttributeValue($this->model, $this->attribute);
/*$attributeValue = [
'image/image.png',
'image/image.png',
'image/image.png',
'image/image.png',
'image/image.png',
];*/
return $this->render('index', [
'title' => $this->title,
'attribute' => $this->attribute,
'attributeValue' => $attributeValue
]);
}
}