THINKPHP5 pagination style, TP5 page style

Source: Internet
Author: User
tihinkphp with the page class style, sometimes can not meet the requirements of the project, here is the main introduction, page-style customization and beautification, make it more concise, beautiful THINKPHP5 controller wording

   Function index ($keyword = ", $page = 1) {        $map = [];        if ($keyword) {            $map [' code '] = [' like ', '%{$keyword}% '];        }        $list =db (' package ')->where ($map)->paginate (, False, [' page ' = + $page]);        return $this->fetch (' Index ', [' list ' = $list, ' keyword ' + $keyword]);    }

Template notation

/* Loop OUTPUT Data *   /{foreach $list as $vo}      ID {$vo. id}   {/foreach}/* page notation *   /{$list->render ()}

Pagination Style

<style>/* paging */.pagination {}.pagination li {display:inline-block;margin-right: -1px;padding:5px;border:1px Solid #e2e2e2; min-width:20px;text-align:center;}. Pagination li.active {background: #009688; color: #fff; border:1px solid #009688;}. Pagination Li a {display:block;text-align:center;} </style>

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.