Compare commits

..

No commits in common. "46564f9450aaf8d859b197dfec549344bec144cb" and "53e5fadfc1e250a397486565d30f27f3853e0559" have entirely different histories.

2 changed files with 0 additions and 78 deletions

View File

@ -1,16 +0,0 @@
<?php
namespace itguild\forms\builders;
use itguild\forms\inputs\BaseInput;
use itguild\forms\inputs\EmailInput;
use itguild\forms\inputs\TextInput;
class EmailBuilder implements Builder
{
public static function build(string $name, array $params = []): BaseInput
{
return new EmailInput(name: $name, paramsArray: $params);
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace itguild\forms\inputs;
use itguild\forms\debug\Debug;
use itguild\forms\inputs\BaseInput;
use itguild\forms\templates\bootstrap5\Bootstrap5Template;
use itguild\forms\templates\Simple\SimpleTemplate;
use itguild\forms\templates\Template;
use itguild\forms\traits\CreateParams;
class EmailInput extends BaseInput
{
use CreateParams;
private string $name;
private array $paramsArray;
/**
* @param string $name
* @param array $paramsArray
*/
public function __construct(string $name, array $paramsArray = [])
{
$this->name = $name;
$this->paramsArray = $paramsArray;
$this->inputTemplate = new SimpleTemplate();
}
/**
* @return self
*/
public function create(): self
{
$paramsString = $this->createParams($this->paramsArray);
$label = "";
$input = "<input name='$this->name' type='email' $paramsString >";
$this->createLabel();
$this->html = str_replace('{input}', $input, $this->inputTemplate->getInputTemplate());
$this->html = str_replace('{label}', $this->labelString, $this->html);
return $this;
}
/**
* @param string $name
* @param array $paramsArray
* @return void
*/
public static function build(string $name, array $paramsArray = []): void
{
$input = new self($name, $paramsArray);
$input->create()->render();
}
}