PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / renderer / Attrs / BoolAttr.php

BoolAttr.php in Tableberg – Simple Gutenberg Table Block 1.1.5, at renderer/Attrs/BoolAttr.php

27 lines 504 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Tableberg\Renderer\Attrs;
4
5 class BoolAttr {
6 /** @var bool */
7 private $value;
8
9 /**
10 * @param bool $value
11 * @param bool $default
12 */
13 public function __construct($value, $default) {
14 $this->value = ($value === null) ? $default : (bool) $value;
15 }
16
17 /** @return bool */
18 public function value() {
19 return $this->value;
20 }
21
22 /** @return string */
23 public function asAttr() {
24 return $this->value ? 'true' : 'false';
25 }
26 }
27