Final Class Yiisoft\Yii\DataView\GridView\Column\RadioColumn
| Inheritance | Yiisoft\Yii\DataView\GridView\Column\RadioColumn |
|---|---|
| Implements | Yiisoft\Yii\DataView\GridView\Column\ColumnInterface |
RadioColumn displays a column of radio buttons in a grid view.
This column type is typically used when you need to allow users to select a single row from the grid. Each radio button in the column shares the same name attribute, ensuring only one can be selected at a time.
Public Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Creates a new RadioColumn instance. |
Yiisoft\Yii\DataView\GridView\Column\RadioColumn |
| getRenderer() | Yiisoft\Yii\DataView\GridView\Column\RadioColumn | |
| isVisible() | Yiisoft\Yii\DataView\GridView\Column\RadioColumn |
Property Details
Method Details
Creates a new RadioColumn instance.
| public mixed __construct ( string|null $header = null, string|null $footer = null, array $columnAttributes = [], array $headerAttributes = [], array $bodyAttributes = [], array $inputAttributes = [], string|null $name = null, Closure|null $content = null, boolean $visible = true ) | ||
| $header | string|null |
The header cell content. If |
| $footer | string|null |
The footer cell content. If |
| $columnAttributes | array |
HTML attributes for all column cells. |
| $headerAttributes | array |
HTML attributes for the header cell. |
| $bodyAttributes | array |
HTML attributes for the body cells. |
| $inputAttributes | array |
HTML attributes for the radio input elements.
The |
| $name | string|null |
The name attribute for all radio inputs in this column. All radio buttons will share this name, ensuring single selection. |
| $content | Closure|null |
Optional callback to generate the radio button value.
Signature: |
| $visible | boolean |
Whether the column is visible. |
public function __construct(
public readonly ?string $header = null,
public readonly ?string $footer = null,
public readonly array $columnAttributes = [],
public readonly array $headerAttributes = [],
public readonly array $bodyAttributes = [],
public array $inputAttributes = [],
?string $name = null,
public ?Closure $content = null,
private readonly bool $visible = true,
) {
if ($name !== null) {
$this->inputAttributes['name'] = $name;
}
}
| public string getRenderer ( ) |
public function getRenderer(): string
{
return RadioColumnRenderer::class;
}
Signup or Login in order to comment.