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/egovers/edwingovers.nl/app/KommaApp/Kms/Core/Attributes/TextField.php
<?php
namespace App\KommaApp\Kms\Core\Attributes;
use App\KommaApp\Kms\Core\Attributes\Traits\ExplanationTrait;
use App\KommaApp\Kms\Core\Attributes\Traits\LabelTrait;
use App\KommaApp\Kms\Core\Attributes\Traits\PlaceholderTextTrait;
use App\KommaApp\Kms\Core\Attributes\Traits\ReadOnlyTrait;

/**
 * Class TextField
 * @package App\KommaApp\Kms\Core\Attributes
 */
class TextField extends Attribute
{
    use LabelTrait;
    use PlaceholderTextTrait;
    use ReadOnlyTrait;
    use ExplanationTrait;

    /** @var string $pattern A javascript regex pattern that is used to define how the text field should be entered. Example [A-Za-z]{3}. Documentation @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions */
    private $pattern;

    /**
     * TextField constructor.
     * @param string $labelText
     */
    public function __construct(string $labelText)
    {
        $this->setLabelText($labelText);
        $this->readOnly = false;

        parent::__construct();
    }

    /**
     * Returns a view that visually represents this attribute
     */
    public function render()
    {
        return \View::make('kms/attributes.textField', [
            'attribute' => $this
        ]);
    }

    /**
     * @return string
     */
    public function getPattern(): ?string
    {
        return $this->pattern;
    }

    /**
     * @param string $pattern
     * @return TextField
     */
    public function setPattern(string $pattern): TextField
    {
        $this->pattern = $pattern;
        return $this;
    }
}