Final Class Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter
| Inheritance | Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter » Yiisoft\Yii\DataView\Filter\Widget\FilterWidget » Yiisoft\Widget\Widget |
|---|
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\Yii\DataView\Filter\Widget\TextInputFilter |
| attributes() | Replace attributes with a new set. | Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter |
| render() | Renders the filter widget using the current context. | Yiisoft\Yii\DataView\Filter\Widget\FilterWidget |
| renderFilter() | Renders the text input filter with the given context. | Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter |
| withContext() | Creates a new instance with the specified filter context. | Yiisoft\Yii\DataView\Filter\Widget\FilterWidget |
Method Details
Add a set of attributes to existing tag attributes.
Same named attributes are replaced.
See also \Yiisoft\Html\Tag\Input::addAttributes().
| 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 \Yiisoft\Html\Tag\Input::attributes().
| 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\Yii\DataView\Filter\Widget\FilterWidget::render()
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\Yii\DataView\Filter\Widget\Context $context ) | ||
| $context | Yiisoft\Yii\DataView\Filter\Widget\Context |
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\Yii\DataView\Filter\Widget\FilterWidget::withContext()
Creates a new instance with the specified filter context.
| public self withContext ( Yiisoft\Yii\DataView\Filter\Widget\Context $context ) | ||
| $context | Yiisoft\Yii\DataView\Filter\Widget\Context |
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;
}
Signup or Login in order to comment.