@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | class YesNo extends Radio |
| 13 | 13 | { |
| 14 | - public function __construct($label, $attributes=[]) |
|
| 14 | + public function __construct($label, $attributes = []) |
|
| 15 | 15 | { |
| 16 | 16 | $options = [ |
| 17 | 17 | '1' => 'Yes', |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | public function __construct($label, $attributes) |
| 17 | 17 | { |
| 18 | 18 | parent::__construct($label, $attributes); |
| 19 | - $this->Attributes()->set('type','month'); |
|
| 20 | - $this->Attributes()->set('pattern','\d{4}-\d{2}'); |
|
| 21 | - $this->Attributes()->set('placeholder','YYYY-MM (e.g. ' . date('Y-m') . ')'); |
|
| 19 | + $this->Attributes()->set('type', 'month'); |
|
| 20 | + $this->Attributes()->set('pattern', '\d{4}-\d{2}'); |
|
| 21 | + $this->Attributes()->set('placeholder', 'YYYY-MM (e.g. '.date('Y-m').')'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | } |
| 25 | 25 | \ No newline at end of file |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | public function __construct($label, $attributes = []) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $class = $this->Attributes()->get('class',''); |
|
| 18 | - $this->Attributes()->set('class',$class? $class.' editor':'editor'); |
|
| 17 | + $class = $this->Attributes()->get('class', ''); |
|
| 18 | + $this->Attributes()->set('class', $class ? $class.' editor' : 'editor'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function __construct($label, $attributes) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $this->Attributes()->set('accept','video/*'); |
|
| 17 | + $this->Attributes()->set('accept', 'video/*'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function __construct($label, $attributes) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $this->Attributes()->set('type','reset'); |
|
| 17 | + $this->Attributes()->set('type', 'reset'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | public function __construct($label, $attributes) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $this->Attributes()->set('type','datetime-local'); |
|
| 18 | - $this->Attributes()->set('pattern','[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}'); |
|
| 19 | - $this->Attributes()->set('placeholder','YYYY-dd-MMTHH:i(e.g. ' . date('Y-m-dTH:i') . ')'); |
|
| 17 | + $this->Attributes()->set('type', 'datetime-local'); |
|
| 18 | + $this->Attributes()->set('pattern', '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}'); |
|
| 19 | + $this->Attributes()->set('placeholder', 'YYYY-dd-MMTHH:i(e.g. '.date('Y-m-dTH:i').')'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function __construct($label, $attributes) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $this->Attributes()->set('type','file'); |
|
| 17 | + $this->Attributes()->set('type', 'file'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | public function __construct($label, $attributes) |
| 14 | 14 | { |
| 15 | 15 | parent::__construct($label, $attributes); |
| 16 | - $this->Attributes()->set('type','datetime'); |
|
| 17 | - $this->Attributes()->set('placeholder','YYYY-dd-MM H:i:s(e.g. ' . date('Y-m-d H:i:s') . ')'); |
|
| 16 | + $this->Attributes()->set('type', 'datetime'); |
|
| 17 | + $this->Attributes()->set('placeholder', 'YYYY-dd-MM H:i:s(e.g. '.date('Y-m-d H:i:s').')'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | public function __construct($label, $attributes = []) |
| 15 | 15 | { |
| 16 | 16 | parent::__construct($label, $attributes); |
| 17 | - $this->Attributes()->set('type','textarea'); |
|
| 18 | - $this->Attributes()->set('rows',$this->Attributes()->get('rows',6)); |
|
| 19 | - $this->Attributes()->set('cols',$this->Attributes()->get('cols',60)); |
|
| 17 | + $this->Attributes()->set('type', 'textarea'); |
|
| 18 | + $this->Attributes()->set('rows', $this->Attributes()->get('rows', 6)); |
|
| 19 | + $this->Attributes()->set('cols', $this->Attributes()->get('cols', 60)); |
|
| 20 | 20 | $this->Attributes()->Ignore('value'); |
| 21 | 21 | $this->Label()->Attribute()->add(['style'=>'vertical-align: top;']); |
| 22 | 22 | } |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | $this->label()->Attribute()->set('for', $this->Attributes()->get('id')); |
| 33 | 33 | |
| 34 | 34 | $html = $this->Label()->RenderHtml(); |
| 35 | - $html .= '<textarea'. $this->Attributes()->RenderHtml().'>'; |
|
| 36 | - $html .= $this->Attributes()->get('value',''); |
|
| 35 | + $html .= '<textarea'.$this->Attributes()->RenderHtml().'>'; |
|
| 36 | + $html .= $this->Attributes()->get('value', ''); |
|
| 37 | 37 | $html .= '</textarea>'; |
| 38 | 38 | return $html; |
| 39 | 39 | } |
@@ -26,8 +26,9 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function RenderHtml(): string |
| 28 | 28 | { |
| 29 | - if (!$this->Attributes()->has('id')) |
|
| 30 | - $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID())); |
|
| 29 | + if (!$this->Attributes()->has('id')) { |
|
| 30 | + $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID())); |
|
| 31 | + } |
|
| 31 | 32 | $this->label()->Attribute()->set('fieldtype', $this->Attributes()->get('type')); |
| 32 | 33 | $this->label()->Attribute()->set('for', $this->Attributes()->get('id')); |
| 33 | 34 | |