# tableberg/1.0.2/renderer/Attrs/BoolAttr.php

Tableberg – Simple Gutenberg Table Block, version 1.0.2. 27 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.0.2/code/renderer/Attrs/BoolAttr.php
- Raw: https://pluginprobe.com/plugins/tableberg/1.0.2/raw/renderer/Attrs/BoolAttr.php
- Modified: 2026-05-04T16:51:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.0.2/code/renderer/Attrs/BoolAttr.php#L10-L20`.

```php
<?php

namespace Tableberg\Renderer\Attrs;

class BoolAttr {
    /** @var bool */
    private $value;

    /**
     * @param bool $value
     * @param bool $default
     */
    public function __construct($value, $default) {
        $this->value = ($value === null) ? $default : (bool) $value;
    }

    /** @return bool */
    public function value() {
        return $this->value;
    }

    /** @return string */
    public function asAttr() {
        return $this->value ? 'true' : 'false';
    }
}

```
