forms/builders/ButtonBuilder.php
2024-05-28 17:10:06 +03:00

19 lines
462 B
PHP
Executable File

<?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);
}
}