HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/stielman.komma.nl/vendor/komma/kms/src/Core/Attributes/TextArea.php
<?php
namespace Komma\KMS\Core\Attributes;

use Komma\KMS\Core\Attributes\Interfaces\HasLabelInterface;
use Komma\KMS\Core\Attributes\Traits\ExplanationTrait;
use Komma\KMS\Core\Attributes\Traits\LabelTrait;
use Komma\KMS\Core\Attributes\Traits\PlaceholderTextTrait;
use Komma\KMS\Core\Attributes\Traits\ReadOnlyTrait;

class TextArea extends Attribute implements HasLabelInterface
{
    use LabelTrait;
    use PlaceholderTextTrait;
    use ReadOnlyTrait;
    use ExplanationTrait;

    private int $height;
    private array $styleFormats = [];
    private string $contentCssUrl = '';
    private bool $tinymceEditor = false;

    /**
     * Returns a view that visually represents this attribute
     */
    public function render(): string
    {
        return view('KMS::attributes.textArea', [
            'attribute' => $this
        ])->render();
    }

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

    /**
     * @return TextArea
     */
    public function enableTinymceEditor(): TextArea
    {
        $this->tinymceEditor = true;
        return $this;
    }

    /**
     * Get the height of a textarea (for when TinyMCE is not enabled).
     *
     * @return int
     */
    public function getHeight(): int
    {
        return $this->height;
    }

    /**
     * Has the textarea a height defined.
     *
     * @return bool
     */
    public function hasHeight(): bool
    {
        return isset($this->height);
    }

    /**
     * Set the height of a textarea (for when TinyMCE is not enabled).
     *
     * @param int $height
     * @return TextArea
     */
    public function setHeight(int $height): TextArea
    {
        $this->height = $height;
        return $this;
    }

    /**
     * Set the style format by the config key
     *
     * @param  string  $configKey
     * @return $this
     */
    public function setStyleFormatFromConfig(string $configKey = 'kms.text_area_style_formats'): TextArea
    {
        $this->styleFormats = config($configKey);
        return $this;
    }

    /**
     * Get the style formats
     *
     * @return array
     */
    public function getStyleFormat(): array
    {
        return $this->styleFormats;
    }

    /**
     * Set the url for the content css file
     *
     * @param  string  $contentCssUrl
     * @return $this
     */
    public function setContentCssUrl(string $contentCssUrl): TextArea
    {
        $this->contentCssUrl = $contentCssUrl;
        return $this;
    }

    /**
     * Get the url for the content css file
     *
     * @return string
     */
    public function getContentCssUrl(): string
    {
        return $this->contentCssUrl;
    }
}