20 lines
443 B
PHP
Executable File
20 lines
443 B
PHP
Executable File
<?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);
|
|
}
|
|
|
|
} |