1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace JeroenNoten\LaravelAdminLte\View\Components\Form; |
4
|
|
|
|
5
|
|
|
class Select2 extends InputGroupComponent |
6
|
|
|
{ |
7
|
|
|
use Traits\OldValueSupportTrait; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* The select2 plugin configuration parameters. Array with key => value |
11
|
|
|
* pairs, where the key should be an existing configuration property of |
12
|
|
|
* the select2 plugin. |
13
|
|
|
* |
14
|
|
|
* @var array |
15
|
|
|
*/ |
16
|
|
|
public $config; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Create a new component instance. |
20
|
|
|
* Note this component requires the 'select2' plugin and the 'bootstrap4' |
21
|
|
|
* css theme. |
22
|
|
|
* |
23
|
|
|
* @return void |
24
|
|
|
*/ |
25
|
3 |
|
public function __construct( |
26
|
|
|
$name, $id = null, $label = null, $igroupSize = null, $labelClass = null, |
27
|
|
|
$fgroupClass = null, $igroupClass = null, $disableFeedback = null, |
28
|
|
|
$errorKey = null, $config = [], $enableOldSupport = null |
29
|
|
|
) { |
30
|
3 |
|
parent::__construct( |
31
|
3 |
|
$name, $id, $label, $igroupSize, $labelClass, $fgroupClass, |
32
|
|
|
$igroupClass, $disableFeedback, $errorKey |
33
|
|
|
); |
34
|
|
|
|
35
|
3 |
|
$this->config = is_array($config) ? $config : []; |
36
|
3 |
|
$this->config['theme'] = 'bootstrap4'; |
37
|
3 |
|
$this->enableOldSupport = isset($enableOldSupport); |
38
|
3 |
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Get the view / contents that represent the component. |
42
|
|
|
* |
43
|
|
|
* @return \Illuminate\View\View|string |
44
|
|
|
*/ |
45
|
1 |
|
public function render() |
46
|
|
|
{ |
47
|
1 |
|
return view('adminlte::components.form.select2'); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|