File: D:/HostingSpaces/vanderkampen/kwaliteitsbouw.com/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;
}
}