0 follower

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

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

ActionColumn is a column for the {@see GridView} widget that displays buttons for viewing and manipulating the items.

Property Details

Hide inherited properties

$after public property
public string|null $after null
$before public property
public string|null $before null
$bodyAttributes public property
public array $bodyAttributes = []
$buttons public property
public array|null $buttons null
$columnAttributes public property
$content public property
public mixed $content null
$footer public property
public string|null $footer null
$footerAttributes public property
$header public property
public string|null $header null
$headerAttributes public property
$template public property
public string|null $template null
$urlConfig public property
public mixed $urlConfig null
$visibleButtons public property
public array|null $visibleButtons null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string|null $template null, string|null $before null, string|null $after null, mixed $urlConfig null, callable|null $urlCreator null, string|null $header null, string|null $footer null, mixed $content null, array|null $buttons null, array|null $visibleButtons null, array $columnAttributes = [], array $headerAttributes = [], array $bodyAttributes = [], array $footerAttributes = [], boolean $visible true )
$template string|null

The template used for composing each cell in the action column.

$before string|null

Content to be prepended to the action column content.

$after string|null

Content to be appended to the action column content.

$urlConfig mixed

URL configuration for generating button URLs.

$urlCreator callable|null

A callback that creates a button URL using the specified data information.

$header string|null

The header cell content.

$footer string|null

The footer cell content.

$content mixed

The content to be rendered in each data cell.

$buttons array|null

Array of buttons. Keys are button names. Values are either instances of {@see \Yiisoft\Yii\DataView\GridView\Column\ActionButton} or a callable with the following signature: function(string $url): string.

$visibleButtons array|null

Array of button visibility rules.

$columnAttributes array

HTML attributes for the column cells.

$headerAttributes array

HTML attributes for the header cell.

$bodyAttributes array

HTML attributes for the body cells.

$footerAttributes array

HTML attributes for the footer cell.

$visible boolean

Whether the column is visible.

                public function __construct(
    public readonly ?string $template = null,
    public readonly ?string $before = null,
    public readonly ?string $after = null,
    public readonly mixed $urlConfig = null,
    ?callable $urlCreator = null,
    public readonly ?string $header = null,
    public readonly ?string $footer = null,
    public readonly mixed $content = null,
    public readonly ?array $buttons = null,
    public readonly ?array $visibleButtons = null,
    public readonly array $columnAttributes = [],
    public readonly array $headerAttributes = [],
    public readonly array $bodyAttributes = [],
    public readonly array $footerAttributes = [],
    private readonly bool $visible = true,
) {
    $this->urlCreator = $urlCreator;
}

            
getRenderer() public method

public string getRenderer ( )

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

            
getUrlCreator() public method

Get the URL creator callback.

public callable|null getUrlCreator ( )
return callable|null

The URL creator callback.

                public function getUrlCreator(): ?callable
{
    return $this->urlCreator;
}

            
isVisible() public method

public boolean isVisible ( )

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