从零开始学YII2框架(三)扩展插件yii2-gird
yii2-gird 插件是Yii2.0的一个扩展。它在官方的girdview基础上扩展了一些实用的功能。非常好用,推荐使用哦。
yii2-gird 插件是Yii2.0的一个扩展。它在官方的girdview基础上扩展了一些实用的功能。
比如:
把表格包装在bootstrap - panel标签下,使之更美观; Float Header功能,实现滑动表格的时候,表字段至于屏幕上方,方便查看; 新增操作栏说明label; 页面统计功能; 新增重置表格功能; 新增导出表格功能,包括四种常用格式[html、CSV、txt、Excel]。
非常感谢Kartik团队带来的好用的插件。Kartik团队的其他插件也很好用的。推荐试用。
安装yii2-grid
使用Composer安装,windows下cmd执行命令:
$ composer require kartik-v/yii2-grid "*"
配置yii2-gird
yii2-gird是一个模块,需要在配置文件中加入模块的配置如下:
*说明:
\kartik\gird\Module配置girdview模块的路径export/download配置导出的Action路径详细说明与Demo
直接看官方文档好了
点击"导出"返回404的解决办法
第一次点击"导出"的时候报错404找不到界面。
分析下点击"导出"时的action完成路径为index.php?=module/export/download
因为我的APP实现了模块化,所以会带有module,即调用模块module下控制器ExportController的downloadAction方法
这里就用到了上面配置的导出Action路径,需要说明的是:插件默认配置是girdview/export/download
需要调用的是模块girdview下的控制器ExportController的downloadAction方法,如果APP不是多模块的,,直接使用默认配置就可以。
所以这里需要复制插件下的ExportController方法到module/Controllers/目录下
再次点击"导出",成功弹窗提示保存文件。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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



How to install extensions on Google Chrome? Google Chrome is very convenient and safe to use. You can use this browser for work, entertainment or study. In this browser, you can install a variety of extension plug-ins to experience rich functions. You need to download them from the plug-in store now. good files, and then install them in Google Chrome. Many users still don’t know how to install these extensions. This site will bring you a tutorial on how to install the Google Chrome extension. I hope it will be helpful to you. Google Chrome extension plug-in installation tutorial method one: drag and drop installation 1. After downloading the plug-in first, open the extension page of the Chrome browser. 2. Navigate to "chrome://extensions/" or press Chr

How to remove jquery from yii2: 1. Edit the AppAsset.php file and comment out the "yii\web\YiiAsset" value in the variable $depends; 2. Edit the main.php file and add the configuration "'yii" under the field "components" \web\JqueryAsset' => ['js' => [],'sourcePath' => null,]," to remove the jquery script.

This article will introduce you to the yii2 framework, share a few CTF exercises, and use them to learn the yii2 framework. I hope it will be helpful to everyone.

1. You need to download the windows version of the master branch of yii2-redis with composer 2. Unzip and copy it to vendor/yiisoft 3. Add 'yiisoft/yii2-redis'=>array('name'=>'yiisoft to extensions.php under yiisoft /yii2-redis','version'=>'2.0.

What should I do if Sogou Browser automatically deactivates extensions? Sogou Browser is very popular because of its complete functions. We are inseparable from the use of browsers in our daily lives. In addition to the functions that come with the browser, Sogou Browser can also add some extensions to help us use the browser better. However, some friends have discovered that Sogou Browser will What should I do if extensions are automatically deactivated? The editor has compiled the solutions and steps for how Sogou Browser will automatically deactivate extensions. Follow me below! What should I do if Sogou Browser automatically deactivates extensions? First, launch Sogou High-speed Browser, then find the "Show Menu" icon consisting of three horizontal lines in the upper right corner, and click it. 2. After clicking, the menu window of Sogou Browser will pop up below. In the window

With the development of Internet technology, many websites have turned to the development of CMS (content management system). Among them, the PHP language CMS system is loved by many developers and users because it has the advantages of open source, free, and flexibility. However, developing a CMS system requires many tools and plug-ins to help us improve efficiency and quality. This article will introduce you to some free tools and recommended extensions for developing CMS systems with PHP. 1. Recommended free tools for PHP development of CMS systems: XAMPPXAMPP is a

How can the 2345 browser allow extensions to run in incognito mode? How do you run an extended plug-in in incognito mode? Here are the detailed methods: When we use the 2345 browser, we will install a lot of extensions, but some friends have found that these extensions cannot be used in incognito mode. So how to allow the plug-ins to be used in incognito mode? How to do it specifically? The editor below has compiled the steps on how to allow extensions to run in incognito mode on the 2345 browser. If not, just follow me and read on! How to allow extensions to run in incognito mode in the 2345 browser 1. First open the 2345 browser, find the icon as shown below in the upper right corner of the browser, and click on the icon with the mouse. 2,

Extension plug-ins are tools that enhance the functionality of the GoLang framework. You can create and register plug-ins to add new functionality and behavior to your application. Plug-ins are created by implementing the MyPlugin interface, and are registered using the plugin.Register function. Practical examples include creating a custom log plug-in to handle logging requests.
