YII2 paging extension implementation jump to a specific page, yii2 page extension Jump _php Tutorial

Source: Internet
Author: User

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, ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.