Author: White Wolf Source: http://www.manks.top/article/yii2_gridview_visible
The copyright belongs to the author, welcome reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
Let's give a simple case
Condition: There is a get shape parameter type
Requirement: The column name is displayed only if the value of type is equal to 1, otherwise the column does not display
The code is implemented as follows:
[ ' attribute ' = ' name ', $model->name, intval(Yii::$app- >request->get (' type ')) = = 1,],
The way of implementation is also very simple drop.
The above describes whether the Yii2 GridView display a column of cases, including the GridView aspect of the content, I hope the PHP tutorial interested in a friend helpful.