Why is the variable assigned by Smarty not output on the template?

Source: Internet
Author: User
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;
  • 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.