0 follower

Final Class Yiisoft\Yii\DataView\GridView\Column\CheckboxColumn

InheritanceYiisoft\Yii\DataView\GridView\Column\CheckboxColumn
ImplementsYiisoft\Yii\DataView\GridView\Column\ColumnInterface

CheckboxColumn displays a column of checkboxes in a grid view.

Psalm Types

Name Value
TContentClosure callable

Property Details

Hide inherited properties

$bodyAttributes public property
public array $bodyAttributes = []
$columnAttributes public property
$content public property
public Closure|null $content null
$footer public property
public string|null $footer null
$header public property
public string|null $header null
$headerAttributes public property
$inputAttributes public property
public array $inputAttributes = []
$multiple public property
public boolean $multiple true

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string|null $header null, string|null $footer null, array $columnAttributes = [], array $headerAttributes = [], array $bodyAttributes = [], array $inputAttributes = [], string|null $name null, boolean $multiple true, Closure|null $content null, boolean $visible true )
$header string|null

The header cell content.

$footer string|null

The footer cell content.

$columnAttributes array

HTML attributes for the column cells.

$headerAttributes array

HTML attributes for the header cell.

$bodyAttributes array

HTML attributes for the body cells.

$inputAttributes array

HTML attributes for the checkbox input elements.

$name string|null

The name attribute of the checkboxes. If specified, it will be assigned to the "name" attribute of the checkbox input.

$multiple boolean

Whether to allow multiple selection. If true, checkbox names will be an array like name[]; if false, checkbox names will be single strings.

$content Closure|null

Closure for generating custom checkbox content. If set, it should have the signature: function(Checkbox $input, DataContext $context): string|Stringable.

$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 readonly bool $multiple = true,
    public ?Closure $content = null,
    private readonly bool $visible = true,
) {
    if ($name !== null) {
        $this->inputAttributes['name'] = $name;
    }
}

            
getRenderer() public method

public string getRenderer ( )

                public function getRenderer(): string
{
    return CheckboxColumnRenderer::class;
}

            
isVisible() public method

public boolean isVisible ( )

                public function isVisible(): bool
{
    return $this->visible;
}