Why is the variable assigned by Smarty not output on the template?
On the Internet to find a page class, add to their own needs of the label, test a bit, Print_r can print output, but the allocation to the template is empty value, a moment did not find that error, please help to see, urgent!
This is a modified paging class, pagediv.php
/*
The display style is as follows:
[1] 2 3 4 5 6 7 8 9 10 ... 100 Next Last Page
Home prev 1..12 13 14 15 [16] 17 18 19 20 ... 100 Next Last Page
Home Prev 1..92 93 94 95 96 97 98 [99] 100
How to use:
$currentPage = $_get[' page ']?$_get[' page ']:1;
$pagediv = new Pagediv ($currentPage, ' test.php?page= ');
$pagediv->show ();
*/
Class Pagediv
{
Public $part 1;
Public $part 2;
Public $part 3;
Public $part 4;
Public $part 5;
/*
Split the following pagination display:
Home prev 1..12 13 14 15 [16] 17 18 19 20 ... 100 Next Last Page
$part 1: Home prev
$part 2:1.
$part 3:12 13 14 15 [16] 17 18 19 20
$part 4: ... 100
$part 5: Next last Page
*/
Public $allPage; Total pages
Public $allRocords; Total Record Count
Public $perPage; Number of records per page
Public $showPagesNo; Displays the total number of page numbers in the page bar 11 total display styles
Public $currentPage; Current page
Public $urlModel; URL link Style
Public $startHidden; Appears 1 ... The number of pages when you start hiding the middle page
Public $endHidden; Appear... 100 pages end hides the middle page
Public function __construct ($allRocords, $perPage, $showPagesNo, $currentPage, $urlModel) {
$this->allrocords = $allRocords;
$this->perpage = $perPage;
$this->showpagesno = $showPagesNo;
$this->currentpage = $currentPage;
$this->urlmodel = $urlModel;
$this->allpage = $this->getallpage ();
$this->starthidden = $this->getint (($this->showpagesno)/2); 6
$this->endhidden = $this->allpage-$this->starthidden; 94
}
Public Function getUrl ($_index = ") {
$_current = $_index;
if ($_index = = ' pre ') $_current = $this->currentpage-1;
if ($_index = = ' Next ') $_current = $this->currentpage+1;
if ($_index = = ") $_current = $this->allpage;