


yii2 gridview whether to display a certain column case gridview control uses gridview paging what is gridview
Jul 29, 2016 am 08:52 AMAuthor: Bailang Source: http://www.manks.top/article/yii2_gridview_visible
The copyright of this article belongs to the author. Reprinting is welcome, but this statement must be retained without the author's consent, and the original text must be given in a prominent position on the article page connection, otherwise we reserve the right to pursue legal liability.
Let’s take a simple case
Condition: There is a get parameter type
Requirement: Only when the value of type is equal to 1, the column name will be displayed, otherwise the column will not be displayed
The code is implemented as follows:
<span>[ </span>'attribute' => 'name', 'value' => <span>$model</span>->name, 'visible' => <span>intval</span>(Yii::<span>$app</span>->request->get('type')) == 1,<span>]</span>,
The implementation method is also very simple.
The above introduces the case of whether yii2 gridview displays a certain column, including the content of GRIDVIEW. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon

Announcement of 2025 PHP Situation Survey
