custom select fix
This commit is contained in:
@ -2,23 +2,21 @@
|
||||
|
||||
namespace kernel\filters;
|
||||
|
||||
use itguild\forms\builders\SelectBuilder;
|
||||
use Itguild\Tables\Filter\Filter;
|
||||
use kernel\helpers\Debug;
|
||||
|
||||
class CustomSelectFilterForAssociativeArr extends Filter
|
||||
{
|
||||
|
||||
public function fetch()
|
||||
public function fetch(): string
|
||||
{
|
||||
$this->html = "<td><select class='form-control' name='$this->name'>";
|
||||
foreach ($this->param as $key => $value) {
|
||||
if ($key == $this->value) {
|
||||
$this->html .= "<option value='$key' selected>$value</option>";
|
||||
} else {
|
||||
$this->html .= "<option value='$key'>$value</option>";
|
||||
}
|
||||
}
|
||||
$this->html .= "value='$this->value'</select></td>";
|
||||
return $this->html;
|
||||
$select = SelectBuilder::build($this->name, [
|
||||
'class' => 'form-control',
|
||||
'options' => $this->param,
|
||||
'value' => $this->value,
|
||||
]);
|
||||
|
||||
return "<td>" . $select->create()->fetch() . "</td>";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user