Загрузить файлы в «src/inputs»
This commit is contained in:
parent
ba427cb74f
commit
7e593b9116
33
src/inputs/TextArea.php
Normal file
33
src/inputs/TextArea.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace src\inputs;
|
||||
use src\traits\CreateParams;
|
||||
class TextArea
|
||||
{
|
||||
use CreateParams;
|
||||
|
||||
private $name;
|
||||
private $value;
|
||||
private $paramsArray;
|
||||
|
||||
public function __construct(string $name, string $value, array $paramsArray = [])
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
$this->paramsArray = $paramsArray;
|
||||
}
|
||||
|
||||
public function create(): void
|
||||
{
|
||||
$paramsString = $this->createParams($this->paramsArray);
|
||||
echo "<textarea name='$this->name' $paramsString>$this->value</textarea>";
|
||||
}
|
||||
|
||||
public static function build(string $name, string $value, array $paramsArray = []): void
|
||||
{
|
||||
$textarea = new self($name, $value, $paramsArray);
|
||||
$textarea->create();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user