NAME Tags::HTML::Pager - Tags helper for pager. SYNOPSIS use Tags::HTML::Pager; my $obj = Tags::HTML::Pager->new(%params); $obj->process($pages_hr); $obj->process_css; METHODS "new" my $obj = Tags::HTML::Pager->new(%params); Constructor. * "css" 'CSS::Struct::Output' object for process_css processing. Default value is undef. * "css_colors" Colors for CSS style. Default value is: { 'actual_background' => 'black', 'actual_color' => 'white', 'border' => 'black', 'hover_background' => 'black', 'hover_color' => 'white', 'other_background' => undef, 'other_color' => 'black', } * "css_pager" Main CSS class of this block. It's required. Default value is 'pager'. * "flag_prev_next" Flag, which mean print of prev_next buttons. Default value is 0. * "flag_paginator" Flag, which mean print of paginator buttons. Default value is 1. * "url_page_cb" Callback for creating of url for view page. Input arguments are: * $page_number Page variable with number of page. * $pages_hr Reference to array which is going to "process". It's required parameter. * "tags" 'Tags::Output' object. Default value is undef. "process" $obj->process($pages_hr); Process Tags structure for output with pager. Returns undef. "process_css" $obj->process_css; Process CSS::Struct structure for output. Returns undef. ERRORS new(): Both paginator styles disabled. Missing 'url_page_cb' parameter. Parameter 'css_pager' is required. From Class::Utils::set_params(): Unknown parameter '%s'. From Tags::HTML::new(): Parameter 'tags' must be a 'Tags::Output::*' class. process(): Missing 'pages_num' parameter in pages data structure. Missing 'actual_page' parameter in pages data structure. Pages data structure is missing. Parameter 'actual_page' is greater than parameter 'pages_num'. actual_page: %s pages_num: %s From Tags::HTML::process(): Parameter 'tags' isn't defined. EXAMPLE use strict; use warnings; use CSS::Struct::Output::Indent; use Tags::HTML::Pager; use Tags::Output::Indent; # Object. my $css = CSS::Struct::Output::Indent->new; my $tags = Tags::Output::Indent->new; my $obj = Tags::HTML::Pager->new( 'css' => $css, 'tags' => $tags, 'url_page_cb' => sub { my $page = shift; return 'https://example.com/?page='.$page; } ); # Process pager. $obj->process({ 'actual_page' => 1, 'pages_num' => 1, }); $obj->process_css; # Print out. print $tags->flush; print "\n\n"; print $css->flush; # Output: #
# # 1 # #
#