smarty分配的变量为什么在模板上输出不了?
在网上找了一个分页类,加进自己需要的标签后,测试了一下,print_r可以打印输出,但是分配的到模板是空值,一时也没找到那出错了,请各位帮忙看看,急!
这个是修改的的分页类,pagediv.php
<br> <br> <?php <br /> /* <br> //显示样式如下: <br> //[1] 2 3 4 5 6 7 8 9 10 ...100 下页 尾页 <br> //首页 上页 1..12 13 14 15 [16] 17 18 19 20 ...100 下页 尾页 <br> //首页 上页 1..92 93 94 95 96 97 98 [99] 100 <br> <br> //使用方法: <br> //$currentPage = $_GET['page']?$_GET['page']:1; <br> //$pagediv = new pagediv(500, 10, 11, $currentPage, 'test.php?page='); <br> //$pagediv->show(); <br> <br> */ <br> class pagediv <br> { <br> public $part1; <br> public $part2; <br> public $part3; <br> public $part4; <br> public $part5; <br> <br> /* <br> 对下面的分页显示进行分割: <br> 首页 上页 1..12 13 14 15 [16] 17 18 19 20 ...100 下页 尾页 <br> $part1 : 首页 上页 <br> $part2 : 1.. <br> $part3 : 12 13 14 15 [16] 17 18 19 20 <br> $part4 : ...100 <br> $part5 : 下页 尾页 <br> */ <br> <br> public $allPage; //总页数 <br> public $allRocords; //总记录数 <br> public $perPage; //每页记录数 <br> public $showPagesNo; //显示分页栏的总页码数 显示样式里共有11个 <br> public $currentPage; //当前页 <br> public $urlModel; //Url链接样式 <br> <br> public $startHidden; //出现 1... 时的页数 开始隐藏中间页 <br> public $endHidden; //出现 ...100 时的页数 结束隐藏中间页 <br> <br> public function __construct($allRocords, $perPage, $showPagesNo, $currentPage, $urlModel){ <br> $this->allRocords = $allRocords; <br> $this->perPage = $perPage; <br> $this->showPagesNo = $showPagesNo; <br> $this->currentPage = $currentPage; <br> $this->urlModel = $urlModel; <br> $this->allPage = $this->getAllPage(); <br> <br> $this->startHidden = $this->getInt(($this->showPagesNo)/2); //6 <br> $this->endHidden = $this->allPage - $this->startHidden; //94 <br> } <br> <br> public function getUrl($_index = ''){ <br> $_current = $_index; <br> if($_index == 'pre') $_current = $this->currentPage -1; <br> if($_index == 'next') $_current = $this->currentPage+1; <br> if($_index == '') $_current = $this->allPage; <div class="clear"> </div>