-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMultiInput.php
47 lines (42 loc) · 1017 Bytes
/
MultiInput.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
<?php
namespace mitalcoi\multi;
use yii\base\Widget;
/**
* Class MultiInput
* @package mitalcoi\multi
*/
class MultiInput extends Widget
{
public $url = 'get-multi';
public $model;
public $relation;
public $rowViewPath;
public $mainLabel;
public $createLabel='Add';
public $deleteLabel='Remove';
public function init()
{
parent::init();
if (!$this->rowViewPath) {
$this->rowViewPath = '_row';
}
}
public function run()
{
MultiAsset::register(
$this->getView()
);
echo $this->render(
'_create',
[
'model' => $this->model,
'relation' => $this->relation,
'rowViewPath' => $this->rowViewPath,
'createLabel' => $this->createLabel,
'deleteLabel' => $this->deleteLabel,
'mainLabel' => $this->mainLabel,
'multi_url'=>$this->url
]
);
}
}