1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace JeroenNoten\LaravelAdminLte\Components; |
4
|
|
|
|
5
|
|
|
use Illuminate\View\Component; |
6
|
|
|
|
7
|
|
|
class TextEditor extends Component |
8
|
|
|
{ |
9
|
|
|
public $id, $name, $label, $placeholder; |
10
|
|
|
public $topclass, $inputclass; |
11
|
|
|
public $body, $disabled, $required; |
12
|
|
|
public $height, $fonts; |
13
|
|
|
public $def_fonts = ['Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Impact', 'Montserrat', 'Open Sans', 'Ubuntu', 'Rajdhani']; |
14
|
|
|
|
15
|
|
|
public function __construct( |
16
|
|
|
$id, $name = null, |
17
|
|
|
$label = 'Input Label', $placeholder = null, |
18
|
|
|
$topclass = null, $inputclass = null, |
19
|
|
|
$body = null, $disabled = false, $required = false, |
20
|
|
|
$height = 500, $fonts = null |
21
|
|
|
) |
22
|
|
|
{ |
23
|
|
|
$this->id = $id; |
24
|
|
|
$this->name = $name; |
25
|
|
|
$this->label = $label; |
26
|
|
|
$this->placeholder = $placeholder; |
27
|
|
|
$this->topclass = $topclass; |
28
|
|
|
$this->inputclass = $inputclass; |
29
|
|
|
$this->body = $body; |
30
|
|
|
$this->required = $required; |
31
|
|
|
$this->disabled = $disabled; |
32
|
|
|
$this->height = $height; |
33
|
|
|
$this->fonts = $fonts; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function fontarray() |
37
|
|
|
{ |
38
|
|
|
return $this->fonts == null ? json_encode($this->def_fonts) : $this->fonts; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function render() |
42
|
|
|
{ |
43
|
|
|
return view('adminlte::text-editor'); |
44
|
|
|
} |
45
|
|
|
} |