PHPCMS分页的用法

前面需要有引用的list,代码如下:

{pc:content action="lists" cat }
  {loop $data $n $r}
    <li><a href="{$r['url']}" title="{$r['title']}">{$r['title']}<span>{date('Y-m-d',$r[inputtime])}</span></a></li>
  {/loop}
{/pc}

注意上面有page属性。

这个代码可以在phpcms后台生成,详见界面->标签向导

 

分页的显示:

<div id="pages" class="pages">{$pages}</div>

只需要一个div,id必须是pages,class随意。

可以自己定义该分页div的样式,这个div内部会生成很多a链接,当前页是一个span,比如如下css:

<style type="text/css">
    .pages {width:100%;margin:10px auto;text-align:center;}
    .pages a {padding:5px;margin:0 8px;}
    .pages a:hover{background-color:#eee;}
    .pages span{padding:5px;background-color:#eee;}
</style>

出来的样式如下图:

phpcms分页用法简介

 

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-08-25
相关资源
相似解决方案