19 lines
462 B
PHP
19 lines
462 B
PHP
|
<?php
|
||
|
|
||
|
namespace itguild\forms\form\builders;
|
||
|
use itguild\forms\form\inputs\Button;
|
||
|
|
||
|
class ButtonBuilder
|
||
|
{
|
||
|
|
||
|
public static function build(string $name, array $params = [])
|
||
|
{
|
||
|
$value = $params['value'] ?? null;
|
||
|
$typeInput = $params['typeInput'] ?? null;
|
||
|
unset($params['value']);
|
||
|
unset($params['typeInput']);
|
||
|
|
||
|
return new Button(name: $name, value: $value ?? null, typeInput: $typeInput, paramsArray: $params);
|
||
|
}
|
||
|
|
||
|
}
|