forms/builders/ButtonBuilder.php

19 lines
462 B
PHP
Raw Normal View History

2024-05-28 17:10:06 +03:00
<?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);
}
}