Giter Club home page Giter Club logo

mojolicious-plugin-bootstrappagination's Introduction

NAME

Mojolicious::Plugin::BootstrapPagination - Page Navigator plugin for Mojolicious This module has derived from Mojolicious::Plugin::PageNavigator

SYNOPSIS

# Mojolicious::Lite
plugin 'bootstrap_pagination'

# Mojolicious
$self->plugin( 'bootstrap_pagination' );

DESCRIPTION

Mojolicious::Plugin::BootstrapPagination generates standard page navigation bar, like

<< 1 2 ... 11 12 13 14 15 ... 85 86 >>

HELPERS

bootstrap_pagination

%= bootstrap_pagination( $current_page, $total_pages, $opts );

Options

Options is a optional ref hash.

%= bootstrap_pagination( $current_page, $total_pages, {
    round => 4,
    outer => 2,
    query => "&id=$id",
    start => 1,
    class => 'pagination-lg',
    param => 'page' } );
  • round

    Number of pages around the current page. Default: 4.

  • outer

    Number of outer window pages (first and last pages). Default 2.

  • param

    Name of param for query url. Default: 'page'

  • query

    Additional query string to url. Optional.

  • start

    Start number for query string. Default: 1. Optional.

INTERNATIONALIZATION

If you want to use internationalization (I18N), you can pass a code reference via localize.

plugin 'bootstrap_pagination' => {
  localize => \&localize,
};


sub localize {
  my ($number) = @_;


  my %trans = (
    1 => 'one',
    2 => 'two',
    6 => 'six',
    7 => 'seven',
    8 => 'eight',
    9 => 'nine',
   10 => 'ten',
   11 => 'eleven',
   12 => 'twelve',
   13 => 'thirteen',
   14 => 'fourteen',
   15 => 'fifteen',
  );


  return $trans{$number};
}

This will print the words instead of the numbers.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us,Mojolicious::Plugin::PageNavigator.

Repository

https://github.com/dokechin/Mojolicious-Plugin-BootstrapPagination

LICENSE

Copyright (C) dokechin.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

dokechin <>

CONTRIBUTORS

Andrey Chips Kuzmin [email protected]

mojolicious-plugin-bootstrappagination's People

Contributors

chipsoid avatar dokechin avatar reneeb avatar sattellite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mojolicious-plugin-bootstrappagination's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.