YII2 paging extension implementation jump to a specific page, yii2 paging extension jump
Author: White Wolf Source: http://www.manks.top/yii2_linkpager_widget.html This article copyright belongs to the author, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location gives the original text connection, Otherwise, the right to pursue legal liability is retained.
Look at the effect first, although the style is a bit ugly, it is not important, I believe that the code you pay more attention to how this feature is implemented!
(see the original picture)
It is not difficult to see, we make jump to a page of the function is based on the extension above the Linkpager, which we implemented before the page extension significantly different, before the obvious is rewritten! Of course, this is not important, we look at the concrete implementation of Golinkpager! The name is a bit lower, not important!
1. Create a new Golinkpager class file in the Frontend\components directory
2, the class inherits Yii\widgets\linkpager;, as follows:
Use useclassextends linkpager {}
3. Add Property public $go = false; Whether to include jump function jump default false
4, rewrite the parent class Linkpager Renderpagebuttons method, the specific direct reference to the following full version of the code, you can mainly see the go part of the code implementation.
[Considering the current domestic web site most of the collection of articles very frequently, not to mention the original source, the original author would like to see the original text, in case there are any problems can not update all articles, to avoid misleading! ]
Continue Reading
http://www.bkjia.com/PHPjc/1132200.html www.bkjia.com true http://www.bkjia.com/PHPjc/1132200.html techarticle implementation of YII2 paging extension jump to a specific page, yii2 page extension jump Author: White Wolf Source: http://www.manks.top/yii2_linkpager_widget.html This article copyright belongs to the author, welcome reprint, ...