forms/builders/SelectBuilder.php

20 lines
443 B
PHP
Raw Permalink Normal View History

2024-05-28 17:10:06 +03:00
<?php
namespace itguild\forms\form\builders;
use itguild\forms\form\inputs\Select;
class SelectBuilder
{
public static function build(string $name, array $params = [])
{
$value = $params['value'] ?? null;
unset($params['value']);
$options = $params['options'] ?? [];
unset($params['options']);
return new Select(name: $name, options: $options, value: $value, paramsArray: $params);
}
}