Final Class Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter
| Inheritance | Yiisoft\ |
|---|
Filter widget that renders a text input for filtering data.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| addAttributes() | Add a set of attributes to existing tag attributes. | Yiisoft\ |
| attributes() | Replace attributes with a new set. | Yiisoft\ |
| render() | Renders the filter widget using the current context. | Yiisoft\ |
| renderFilter() | Renders the text input filter with the given context. | Yiisoft\ |
| withContext() | Creates a new instance with the specified filter context. | Yiisoft\ |
Method Details
Add a set of attributes to existing tag attributes.
Same named attributes are replaced.
See also \
| public self addAttributes ( array $attributes ) | ||
| $attributes | array |
Name-value set of attributes. |
| return | self |
New instance with added attributes. |
|---|---|---|
public function addAttributes(array $attributes): self
{
$new = clone $this;
$new->input = $this->getInput()->addAttributes($attributes);
return $new;
}
Replace attributes with a new set.
See also \
| public self attributes ( array $attributes ) | ||
| $attributes | array |
Name-value set of attributes. |
| return | self |
New instance with replaced attributes. |
|---|---|---|
public function attributes(array $attributes): self
{
$new = clone $this;
$new->input = $this->getInput()->attributes($attributes);
return $new;
}
Defined in:
Yiisoft\
Renders the filter widget using the current context.
| public string render ( ) | ||
| return | string |
The rendered HTML for the filter input. |
|---|---|---|
final public function render(): string
{
return $this->renderFilter($this->context);
}
Renders the text input filter with the given context.
| public string renderFilter ( Yiisoft\ | ||
| $context | Yiisoft\ |
The filter context. |
| return | string |
The rendered HTML input element. |
|---|---|---|
public function renderFilter(Context $context): string
{
return $this->getInput()
->name($context->property)
->value($context->value)
->form($context->formId)
->type('text')
->render();
}
Defined in:
Yiisoft\
Creates a new instance with the specified filter context.
| public self withContext ( Yiisoft\ | ||
| $context | Yiisoft\ |
The filter context containing property, value, and form data. |
| return | self |
New instance with the specified context. |
|---|---|---|
final public function withContext(Context $context): self
{
$new = clone $this;
$new->context = $context;
return $new;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.