smarty中分页时把字符型内容转为数组?

#1 helloniu

$oAcls=spClass("tbl_a");
                $Sql = "select test from a ";
                $results=$oAcls->spPager($this->spArgs('page', 1), 25)->findSql($Sql);
                $this->a=$results;
                $this->pager=$oAcls->spPager()->getPager();
                $this->display("a.html");


分页里面有一个字段内容为:1,2,3,4,5,6,7,8

如何在分页显示时把字符型内容改为数组方式?

2010-12-30 16:54:27

#2 jake

不明,显示页面的HTML模板可以参考论坛内的例子

http://speedphp.com/bbs/thread-679-1-1.html

2010-12-30 17:17:01

#3 helloniu

$sp=spclass("guestbook");
                 $sql="SELECT * from guestbook";
                 $this->results= $sp->spPager($this->spArgs('page',1),30)->findSql($sql);
         $this->pager = $sp->spPager()->getPager();
         $this->display('main.html');


findSql方式为什么分页不成功啊

2010-12-30 17:38:44

#4 jake

$sp=spclass("guestbook");
                 $sql="SELECT * from guestbook";
                  $this->results= $sp->spPager($this ...
helloniu 发表于 2010-12-30 17:38
spPager($this->spArgs('page',1),30)

那么就要记录超过30条才会有分页的效果,你可以试试1或者2看看

2010-12-30 17:54:33

#5 helloniu

我里面加了很多数据   不是这个每页显示多少条的问题

2010-12-30 17:57:50

#6 helloniu

哈哈 可以了  是我的疏忽

2010-12-30 18:04:03