igmf/kernel/filters/BootstrapSelectFilter.php

23 lines
545 B
PHP
Raw Normal View History

2024-12-24 16:38:28 +03:00
<?php
namespace kernel\filters;
2024-12-25 11:40:33 +03:00
use itguild\forms\builders\SelectBuilder;
2024-12-24 16:38:28 +03:00
use Itguild\Tables\Filter\Filter;
use kernel\helpers\Debug;
2024-12-25 16:32:23 +03:00
class BootstrapSelectFilter extends Filter
2024-12-24 16:38:28 +03:00
{
2024-12-25 11:40:33 +03:00
public function fetch(): string
2024-12-24 16:38:28 +03:00
{
2024-12-25 11:40:33 +03:00
$select = SelectBuilder::build($this->name, [
'class' => 'form-control',
2024-12-27 13:50:37 +03:00
'options' => $this->params['options'],
2024-12-25 11:40:33 +03:00
'value' => $this->value,
2024-12-27 13:50:37 +03:00
'prompt' => $this->params['prompt'] ?? null,
2024-12-25 11:40:33 +03:00
]);
return "<td>" . $select->create()->fetch() . "</td>";
2024-12-24 16:38:28 +03:00
}
}