0 フォロワー

クラス yii\grid\ActionColumn

継承yii\grid\ActionColumn » yii\grid\Column » yii\base\BaseObject
実装yii\base\Configurable
利用可能なバージョン2.0
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/grid/ActionColumn.php

ActionColumn は、アイテムの表示と操作のためのボタンを表示する yii\grid\GridView ウィジェットのカラムです。

GridViewにActionColumnを追加するには、以下のようにcolumns設定に追加します。

'columns' => [
    // ...
    [
        'class' => ActionColumn::class,
        // you may configure additional properties here
    ],
]

ActionColumnの詳細と使用方法については、データウィジェットに関するガイド記事を参照してください。

公開プロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元
$buttonOptions array デフォルトボタンに適用されるHTMLオプション。 yii\grid\ActionColumn
$buttons array ボタンレンダリングコールバック。 yii\grid\ActionColumn
$content callable 各セルのコンテンツを生成するために使用されるコールバック関数。 yii\grid\Column
$contentOptions array|Closure データセルタグのHTML属性。 yii\grid\Column
$controller string|null ここで指定されたアクションを処理するコントローラのID。 yii\grid\ActionColumn
$filterOptions array フィルターセルタグのHTML属性。 yii\grid\Column
$footer string フッターセルのコンテンツ。 yii\grid\Column
$footerOptions array フッターセルタグのHTML属性。 yii\grid\Column
$grid yii\grid\GridView このカラムを所有するグリッドビューオブジェクト。 yii\grid\Column
$header string|null ヘッダーセルのコンテンツ。 yii\grid\Column
$headerOptions array ヘッダーセルタグのHTML属性。 yii\grid\ActionColumn
$icons array ボタンアイコン。 yii\grid\ActionColumn
$options array カラムグループタグのHTML属性。 yii\grid\Column
$template string アクションカラムの各セルを構成するために使用されるテンプレート。 yii\grid\ActionColumn
$urlCreator callable|null 指定されたモデル情報を使用してボタンURLを作成するコールバック関数。 yii\grid\ActionColumn
$visible boolean このカラムが表示されるかどうか。 yii\grid\Column
$visibleButtons array 各ボタンの表示条件。 yii\grid\ActionColumn

公開メソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__call() クラスメソッドではない名前付きメソッドを呼び出します。 yii\base\BaseObject
__construct() コンストラクタ。 yii\base\BaseObject
__get() オブジェクトプロパティの値を返します。 yii\base\BaseObject
__isset() プロパティが設定されているかどうか(つまり、定義されていてnullではないか)を確認します。 yii\base\BaseObject
__set() オブジェクトプロパティの値を設定します。 yii\base\BaseObject
__unset() オブジェクトプロパティをnullに設定します。 yii\base\BaseObject
canGetProperty() プロパティを読み取ることができるかどうかを示す値を返します。 yii\base\BaseObject
canSetProperty() プロパティを設定できるかどうかを示す値を返します。 yii\base\BaseObject
className() このクラスの完全修飾名を返します。 yii\base\BaseObject
createUrl() 指定されたアクションとモデルのURLを作成します。 yii\grid\ActionColumn
hasMethod() メソッドが定義されているかどうかを示す値を返します。 yii\base\BaseObject
hasProperty() プロパティが定義されているかどうかを示す値を返します。 yii\base\BaseObject
init() オブジェクトを初期化します。 yii\grid\ActionColumn
renderDataCell() データセルをレンダリングします。 yii\grid\Column
renderFilterCell() フィルターセルをレンダリングします。 yii\grid\Column
renderFooterCell() フッターセルをレンダリングします。 yii\grid\Column
renderHeaderCell() ヘッダーセルをレンダリングします。 yii\grid\Column

保護されたメソッド

継承されたメソッドを非表示

メソッド 説明 定義元
getHeaderCellLabel() ヘッダーセルのラベルを返します。 yii\grid\Column
initDefaultButton() 単一ボタンのデフォルトボタンレンダリングコールバックを初期化します。 yii\grid\ActionColumn
initDefaultButtons() デフォルトのボタンレンダリングコールバックを初期化します。 yii\grid\ActionColumn
renderDataCellContent() データセルのコンテンツをレンダリングします。 yii\grid\ActionColumn
renderFilterCellContent() フィルターセルのコンテンツをレンダリングします。 yii\grid\Column
renderFooterCellContent() フッターセルのコンテンツをレンダリングします。 yii\grid\Column
renderHeaderCellContent() ヘッダーセルのコンテンツをレンダリングします。 yii\grid\Column

プロパティの詳細

継承されたプロパティを非表示

$buttonOptions public property (バージョン 2.0.4 から利用可能)

デフォルトボタンに適用されるHTMLオプション。

public array $buttonOptions = []
$buttons public property

ボタンレンダリングコールバック。配列のキーはボタン名(中括弧なし)、値は対応するボタンレンダリングコールバックです。コールバック関数は次のシグネチャを使用する必要があります。

function ($url, $model, $key) {
    // return the button HTML code
}

ここで、$urlは列がボタンのために作成するURL、$modelは現在の行に対してレンダリングされているモデルオブジェクト、$keyはデータプロバイダー配列内のモデルのキーです。

ボタンにさらに条件を追加できます。たとえば、モデルが編集可能な場合にのみ表示する(ここでは、それを示すステータスフィールドがあると仮定します)

[
    'update' => function ($url, $model, $key) {
        return $model->status === 'editable' ? Html::a('Update', $url) : '';
    },
],
public array $buttons = []
$controller public property

ここで指定されたアクションを処理するコントローラのID。設定されていない場合、現在アクティブなコントローラを使用します。このプロパティは主に、$urlCreatorによって、異なるアクションのURLを作成するために使用されます。このプロパティの値は、各アクション名に接頭辞として付け加えられ、アクションのルートを形成します。

public string|null $controller null
$headerOptions public property

ヘッダーセルタグのHTML属性。

public array $headerOptions = [
    
'class' => 'action-column',
]
$icons public property (version 2.0.42から利用可能)

ボタンのアイコン。配列のキーはアイコン名、値は対応するHTMLです: `php [

'eye-open' => '<svg ...></svg>',
'pencil' => Html::tag('span', '', ['class' => 'glyphicon glyphicon-pencil'])

] ` デフォルトはFontAwesome 5の無料SVGアイコンです。

こちらも参照してください https://fontawesome.com.

public array $icons = [
    
'eye-open' => '<svg aria-hidden="true" style="display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em;width:1.125em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M573 241C518 136 411 64 288 64S58 136 3 241a32 32 0 000 30c55 105 162 177 285 177s230-72 285-177a32 32 0 000-30zM288 400a144 144 0 11144-144 144 144 0 01-144 144zm0-240a95 95 0 00-25 4 48 48 0 01-67 67 96 96 0 1092-71z"/></svg>',
    
'pencil' => '<svg aria-hidden="true" style="display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em;width:1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M498 142l-46 46c-5 5-13 5-17 0L324 77c-5-5-5-12 0-17l46-46c19-19 49-19 68 0l60 60c19 19 19 49 0 68zm-214-42L22 362 0 484c-3 16 12 30 28 28l122-22 262-262c5-5 5-13 0-17L301 100c-4-5-12-5-17 0zM124 340c-5-6-5-14 0-20l154-154c6-5 14-5 20 0s5 14 0 20L144 340c-6 5-14 5-20 0zm-36 84h48v36l-64 12-32-31 12-65h36v48z"/></svg>',
    
'trash' => '<svg aria-hidden="true" style="display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em;width:.875em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M32 464a48 48 0 0048 48h288a48 48 0 0048-48V128H32zm272-256a16 16 0 0132 0v224a16 16 0 01-32 0zm-96 0a16 16 0 0132 0v224a16 16 0 01-32 0zm-96 0a16 16 0 0132 0v224a16 16 0 01-32 0zM432 32H312l-9-19a24 24 0 00-22-13H167a24 24 0 00-22 13l-9 19H16A16 16 0 000 48v32a16 16 0 0016 16h416a16 16 0 0016-16V48a16 16 0 00-16-16z"/></svg>',
]
$template public property

アクション列の各セルを構成するために使用されるテンプレート。波括弧で囲まれたトークンは、コントローラの動作ID(アクション列のコンテキストではボタン名とも呼ばれます)として扱われます。これらは、$buttonsで指定された対応するボタンレンダリングコールバックによって置き換えられます。たとえば、トークン{view}は、コールバックbuttons['view']の結果で置き換えられます。コールバックが見つからない場合、トークンは空文字列で置き換えられます。

例として、表示ボタンと更新ボタンのみを持つには、次のようにGridViewの列にActionColumnを追加します。

['class' => 'yii\grid\ActionColumn', 'template' => '{view} {update}'],

こちらも参照してください $buttons.

public string $template '{view} {update} {delete}'
$urlCreator public property

指定されたモデル情報を使用してボタンURLを作成するコールバック。コールバックのシグネチャは、createUrl()と同じである必要があります。2.0.10以降、列インスタンス自体を参照する追加のパラメータを受け入れることができます。

function (string $action, mixed $model, mixed $key, integer $index, ActionColumn $this) {
    //return string;
}

このプロパティが設定されていない場合、ボタンURLはcreateUrl()を使用して作成されます。

public callable|null $urlCreator null
$visibleButtons public property (version 2.0.7から利用可能)

各ボタンの表示条件。配列のキーはボタン名(波括弧なし)、値は真偽値または無名関数です。この配列にボタン名が指定されていない場合、デフォルトで表示されます。コールバックは次のシグネチャを使用する必要があります。

function ($model, $key, $index) {
    return $model->status === 'editable';
}

または、真偽値を渡すこともできます。

[
    'update' => \Yii::$app->user->can('update'),
],
public array $visibleButtons = []

メソッドの詳細

継承されたメソッドを非表示

__call() public method

定義場所: yii\base\BaseObject::__call()

クラスメソッドではない名前付きメソッドを呼び出します。

これはPHPのマジックメソッドであり、不明なメソッドが呼び出されたときに暗黙的に呼び出されるため、直接呼び出さないでください。

public mixed __call ( $name, $params )
$name string

メソッド名

$params array

メソッドパラメータ

戻り値 mixed

メソッドの戻り値

例外 yii\base\UnknownMethodException

不明なメソッドを呼び出した場合

                public function __call($name, $params)
{
    throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}

            
__construct() public method

定義場所: yii\base\BaseObject::__construct()

コンストラクタ。

デフォルトの実装では、次の2つのことを行います。

  • 与えられた設定$configでオブジェクトを初期化します。
  • init()を呼び出します。

このメソッドを子クラスでオーバーライドする場合は、

  • コンストラクタの最後のパラメータが、ここにある$configのような設定配列であることをお勧めします。
  • コンストラクタの最後に、親の実装を呼び出してください。
public void __construct ( $config = [] )
$config array

オブジェクトのプロパティを初期化するために使用される名前と値のペア

                public function __construct($config = [])
{
    if (!empty($config)) {
        Yii::configure($this, $config);
    }
    $this->init();
}

            
__get() publicメソッド

定義済み: yii\base\BaseObject::__get()

オブジェクトプロパティの値を返します。

これはPHPのマジックメソッドであり、$value = $object->property;を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

参照: __set().

public mixed __get ( $name )
$name string

プロパティ名

戻り値 mixed

プロパティ値

例外 yii\base\UnknownPropertyException

プロパティが定義されていない場合

例外 yii\base\InvalidCallException

プロパティが書き込み専用の場合

                public function __get($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter();
    } elseif (method_exists($this, 'set' . $name)) {
        throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
    }
    throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}

            
__isset() publicメソッド

定義済み: yii\base\BaseObject::__isset()

プロパティが設定されているかどうか(つまり、定義されていてnullではないか)を確認します。

これはPHPのマジックメソッドであり、isset($object->property)を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

プロパティが定義されていない場合は、falseが返されることに注意してください。

参照: https://www.php.net/manual/en/function.isset.php.

public boolean __isset ( $name )
$name string

プロパティ名またはイベント名

戻り値 boolean

指定されたプロパティが設定されているかどうか(nullではない)。

                public function __isset($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter() !== null;
    }
    return false;
}

            
__set() publicメソッド

定義済み: yii\base\BaseObject::__set()

オブジェクトプロパティの値を設定します。

これはPHPのマジックメソッドであり、$object->property = $value;を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

参照: __get().

public void __set ( $name, $value )
$name string

プロパティ名またはイベント名

$value mixed

プロパティ値

例外 yii\base\UnknownPropertyException

プロパティが定義されていない場合

例外 yii\base\InvalidCallException

プロパティが読み取り専用の場合

                public function __set($name, $value)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

            
__unset() publicメソッド

定義済み: yii\base\BaseObject::__unset()

オブジェクトプロパティをnullに設定します。

これはPHPのマジックメソッドであり、unset($object->property)を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

プロパティが定義されていない場合、このメソッドは何もしません。プロパティが読み取り専用の場合は、例外をスローします。

参照: https://www.php.net/manual/en/function.unset.php.

public void __unset ( $name )
$name string

プロパティ名

例外 yii\base\InvalidCallException

プロパティが読み取り専用の場合。

                public function __unset($name)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter(null);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Unsetting read-only property: ' . get_class($this) . '::' . $name);
    }
}

            
canGetProperty() publicメソッド

定義済み: yii\base\BaseObject::canGetProperty()

プロパティを読み取ることができるかどうかを示す値を返します。

プロパティは、以下の場合に読み取り可能です。

  • クラスが指定された名前に関連付けられたゲッターメソッドを持つ場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持つ場合($checkVarsがtrueの場合)。

参照: canSetProperty().

public boolean canGetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティを読み取ることができるかどうか

                public function canGetProperty($name, $checkVars = true)
{
    return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);
}

            
canSetProperty() publicメソッド

定義済み: yii\base\BaseObject::canSetProperty()

プロパティを設定できるかどうかを示す値を返します。

プロパティは、以下の場合に書き込み可能です。

  • クラスが指定された名前に関連付けられたセッターメソッドを持つ場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持つ場合($checkVarsがtrueの場合)。

参照: canGetProperty().

public boolean canSetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティを書き込むことができるかどうか

                public function canSetProperty($name, $checkVars = true)
{
    return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
}

            
className() public staticメソッド
2.0.14以降非推奨。PHP >= 5.5では、代わりに::classを使用してください。

定義済み: yii\base\BaseObject::className()

このクラスの完全修飾名を返します。

public static string className ( )
戻り値 string

このクラスの完全修飾名。

                public static function className()
{
    return get_called_class();
}

            
createUrl() publicメソッド

指定されたアクションとモデルのURLを作成します。

このメソッドは、各ボタンと各行に対して呼び出されます。

public string createUrl ( $action, $model, $key, $index )
$action string

ボタン名(またはアクションID)

$model yii\db\ActiveRecordInterface

データモデル

$key mixed

データモデルに関連付けられたキー

$index integer

現在の行インデックス

戻り値 string

作成されたURL

                public function createUrl($action, $model, $key, $index)
{
    if (is_callable($this->urlCreator)) {
        return call_user_func($this->urlCreator, $action, $model, $key, $index, $this);
    }
    $params = is_array($key) ? $key : ['id' => (string) $key];
    $params[0] = $this->controller ? $this->controller . '/' . $action : $action;
    return Url::toRoute($params);
}

            
getHeaderCellLabel() protectedメソッド (バージョン2.0.8以降で使用可能)

定義済み: yii\grid\Column::getHeaderCellLabel()

ヘッダーセルのラベルを返します。

ヘッダーセルのラベルをカスタマイズするために、このメソッドをオーバーライドできます。

protected string getHeaderCellLabel ( )
戻り値 string

ラベル

                protected function getHeaderCellLabel()
{
    return $this->grid->emptyCell;
}

            
hasMethod() publicメソッド

定義済み: yii\base\BaseObject::hasMethod()

メソッドが定義されているかどうかを示す値を返します。

デフォルトの実装は、PHP関数method_exists()への呼び出しです。PHPマジックメソッド__call()を実装した場合は、このメソッドをオーバーライドできます。

public boolean hasMethod ( $name )
$name string

メソッド名

戻り値 boolean

メソッドが定義されているかどうか

                public function hasMethod($name)
{
    return method_exists($this, $name);
}

            
hasProperty() publicメソッド

定義位置: yii\base\BaseObject::hasProperty()

プロパティが定義されているかどうかを示す値を返します。

プロパティは、以下の場合に定義済みとみなされます。

  • 指定された名前に関連付けられたゲッターまたはセッターメソッドがクラスに存在する場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持つ場合($checkVarsがtrueの場合)。

参照

public boolean hasProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティが定義されているかどうか

                public function hasProperty($name, $checkVars = true)
{
    return $this->canGetProperty($name, $checkVars) || $this->canSetProperty($name, false);
}

            
init() publicメソッド

オブジェクトを初期化します。

このメソッドは、オブジェクトが与えられた設定で初期化された後、コンストラクタの最後に呼び出されます。

public void init ( )

                public function init()
{
    parent::init();
    $this->initDefaultButtons();
}

            
initDefaultButton() protectedメソッド (バージョン2.0.11から利用可能)

単一ボタンのデフォルトボタンレンダリングコールバックを初期化します。

protected void initDefaultButton ( $name, $iconName, $additionalOptions = [] )
$name string

テンプレートに記述されているボタン名

$iconName string

Bootstrapのglyphiconクラスの中で一意性を保つ部分

$additionalOptions array

追加オプションの配列

                protected function initDefaultButton($name, $iconName, $additionalOptions = [])
{
    if (!isset($this->buttons[$name]) && strpos($this->template, '{' . $name . '}') !== false) {
        $this->buttons[$name] = function ($url, $model, $key) use ($name, $iconName, $additionalOptions) {
            switch ($name) {
                case 'view':
                    $title = Yii::t('yii', 'View');
                    break;
                case 'update':
                    $title = Yii::t('yii', 'Update');
                    break;
                case 'delete':
                    $title = Yii::t('yii', 'Delete');
                    break;
                default:
                    $title = ucfirst($name);
            }
            $options = array_merge([
                'title' => $title,
                'aria-label' => $title,
                'data-pjax' => '0',
            ], $additionalOptions, $this->buttonOptions);
            $icon = isset($this->icons[$iconName])
                ? $this->icons[$iconName]
                : Html::tag('span', '', ['class' => "glyphicon glyphicon-$iconName"]);
            return Html::a($icon, $url, $options);
        };
    }
}

            
initDefaultButtons() protectedメソッド

デフォルトのボタンレンダリングコールバックを初期化します。

protected void initDefaultButtons ( )

                protected function initDefaultButtons()
{
    $this->initDefaultButton('view', 'eye-open');
    $this->initDefaultButton('update', 'pencil');
    $this->initDefaultButton('delete', 'trash', [
        'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
        'data-method' => 'post',
    ]);
}

            
renderDataCell() publicメソッド

定義位置: yii\grid\Column::renderDataCell()

データセルをレンダリングします。

public string renderDataCell ( $model, $key, $index )
$model mixed

レンダリングされるデータモデル

$key mixed

データモデルに関連付けられたキー

$index integer

yii\grid\GridView::$dataProviderによって返されるアイテム配列における、データアイテムのゼロベースインデックス。

戻り値 string

レンダリング結果

                public function renderDataCell($model, $key, $index)
{
    if ($this->contentOptions instanceof Closure) {
        $options = call_user_func($this->contentOptions, $model, $key, $index, $this);
    } else {
        $options = $this->contentOptions;
    }
    return Html::tag('td', $this->renderDataCellContent($model, $key, $index), $options);
}

            
renderDataCellContent() protectedメソッド

データセルのコンテンツをレンダリングします。

protected string renderDataCellContent ( $model, $key, $index )
$model mixed

データモデル

$key mixed

データモデルに関連付けられたキー

$index integer

yii\grid\GridView::$dataProviderによって返されるモデル配列における、データモデルのゼロベースインデックス。

戻り値 string

レンダリング結果

                protected function renderDataCellContent($model, $key, $index)
{
    return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($model, $key, $index) {
        $name = $matches[1];
        if (isset($this->visibleButtons[$name])) {
            $isVisible = $this->visibleButtons[$name] instanceof \Closure
                ? call_user_func($this->visibleButtons[$name], $model, $key, $index)
                : $this->visibleButtons[$name];
        } else {
            $isVisible = true;
        }
        if ($isVisible && isset($this->buttons[$name])) {
            $url = $this->createUrl($name, $model, $key, $index);
            return call_user_func($this->buttons[$name], $url, $model, $key);
        }
        return '';
    }, $this->template);
}

            
renderFilterCell() publicメソッド

定義位置: yii\grid\Column::renderFilterCell()

フィルターセルをレンダリングします。

public void renderFilterCell ( )

                public function renderFilterCell()
{
    return Html::tag('td', $this->renderFilterCellContent(), $this->filterOptions);
}

            
renderFilterCellContent() protectedメソッド

定義位置: yii\grid\Column::renderFilterCellContent()

フィルターセルのコンテンツをレンダリングします。

デフォルトの実装では、単にスペースをレンダリングします。このメソッドをオーバーライドして、フィルターセルのレンダリングをカスタマイズできます(もしあれば)。

protected string renderFilterCellContent ( )
戻り値 string

レンダリング結果

                protected function renderFilterCellContent()
{
    return $this->grid->emptyCell;
}

            
renderFooterCell() publicメソッド

定義位置: yii\grid\Column::renderFooterCell()

フッターセルをレンダリングします。

public void renderFooterCell ( )

                public function renderFooterCell()
{
    return Html::tag('td', $this->renderFooterCellContent(), $this->footerOptions);
}

            
renderFooterCellContent() protectedメソッド

定義位置: yii\grid\Column::renderFooterCellContent()

フッターセルのコンテンツをレンダリングします。

デフォルトの実装では、単に$footerをレンダリングします。このメソッドをオーバーライドして、フッターセルのレンダリングをカスタマイズできます。

protected string renderFooterCellContent ( )
戻り値 string

レンダリング結果

                protected function renderFooterCellContent()
{
    return $this->footer !== null && trim($this->footer) !== '' ? $this->footer : $this->grid->emptyCell;
}

            
renderHeaderCell() publicメソッド

定義位置: yii\grid\Column::renderHeaderCell()

ヘッダーセルをレンダリングします。

public void renderHeaderCell ( )

                public function renderHeaderCell()
{
    return Html::tag('th', $this->renderHeaderCellContent(), $this->headerOptions);
}

            
renderHeaderCellContent() protectedメソッド

定義位置: yii\grid\Column::renderHeaderCellContent()

ヘッダーセルのコンテンツをレンダリングします。

デフォルトの実装では、単に$headerをレンダリングします。このメソッドをオーバーライドして、ヘッダーセルのレンダリングをカスタマイズできます。

protected string renderHeaderCellContent ( )
戻り値 string

レンダリング結果

                protected function renderHeaderCellContent()
{
    return $this->header !== null && trim($this->header) !== '' ? $this->header : $this->getHeaderCellLabel();
}