,设置分页容器参考laraver手册 我的设置代码如下:

//设置分页容器  /app/models/ZurbPresenter.php
<?php 
    class ZurbPresenter extends Illuminate\Pagination\Presenter {
    public function getPageLinkWrapper($url, $page, $rel = null)
    {
        $rel = is_null($rel) ? '' : ' rel="'.$rel.'"';
        return '<li><a href=javascript:goodslist("'.$url.'");>'.$page.'</a></li>';
    }
    public function getDisabledTextWrapper($text)
    {
        return '<li class="disabled"><span>'.$text.'</span></li>';
    }
    public function getActivePageWrapper($text)
    {
        return '<li class="active"><span>'.$text.'</span></li>';
    }
}
//设置分页模板 /app/view/page/page.blade.php
<ul class="pagination">
    <?php echo with(new ZurbPresenter($paginator))->render(); ?>
</ul>
//设置配置文件 /app/config/view.php
<?php
return array(
    'paths' => array(__DIR__.'/../views'),
    //'pagination' => 'pagination::slider-3',
    'pagination' => 'page.page',
);
,控制器调用的方法:代码如下 private function toAjaxTpl($templateFile='',$data='') {
        $viewobj = View::make($templateFile,array('data'=>$data));
        $path= $viewobj->getPath();
        ob_start();
        ob_implicit_flush();
        include($path);
        $content = ob_get_clean();
        return $content;
    }
public function getList(){
        $reult = $this->brand->paginate();
        $content = $this->toAjaxTpl('member::publish.ajaxtpl.ajaxsold',$reult);
        $data = ['status'=>true,'data'=>$content];
        return Response::json($data);
    }
,ajax分页模板代码 <thead>
    <tr>
        <th>商品</th>
        <th>金额</th>
        <th>发布时间</th>
        <th>过期时间</th>
        <th>操作</th>
    </tr>
</thead>
<tbody>
<?php 
    foreach($data as $d){
?>
    <tr>
      <td valign="middle">
                <a href=""><img src="../images/uCenter/nail.jpg" width="" height=""/><?php echo $d->title ; ?></a>            </td>
      <td>9999元11</td>
      <td><?php echo $d->created_at; ?></td>
      <td><?php echo $d->validity_date; ?></td>
       <td><i class="icon icon-eye-open tip0"  data-toggle="tooltip" data-placement="top" title="查看"></i> | 
                   <i class="icon  icon-edit tip0" data-toggle="tooltip" data-placement="top" title="编辑"></i>           <br />                    <i class="icon  icon-chevron-down tip0" data-toggle="tooltip" data-placement="top" title="下架"></i> |                     <i class="icon icon-remove tip0"  data-toggle="tooltip" data-placement="top" title="删除"></i>
      </td>
    </tr>
<?php
    }
?>
</tbody>
<tfoot>
    <tr>
    <td cols='' > <?php echo $data->links(); ?></td>
    </tr>
</tfoot>
................
//js代码:
<script type="text/javascript">
    var tm_classify=[];
    function expire(){
        var url = '{{ route("member.publish.getlist") }}';
         $.getJSON(url,function(data){
        console.info(data);
        $('#expire').html(data.data);
        }); 
    };
    function goodslist(url){
    $.getJSON(url,function(data){
        $('#expire').html(data.data);
    });
    }
</script>

最新文章

  1. Kafka副本管理—— 为何去掉replica.lag.max.messages参数
  2. Delphi_06_Delphi_Object_Pascal_基本语法_04
  3. 实体生命周期【Entity Lifecycle】(EF基础系列10)
  4. centos7.0 手动编译 lamp环境
  5. Ajax的简单请求案例
  6. 基于Java的Http服务器几种模式演进
  7. MatLab计算图像圆度
  8. 使用SQL脚本删除冗余的视图和表
  9. 【JAVA零基础入门系列】Day11 Java中的类和对象
  10. python基础的输入字符串的格式化
  11. 剑指Offer-按之字形顺序打印二叉树
  12. 设计APP时我们该怎么做
  13. Dialog样式的Activity
  14. 有关Spring注解@xxx的零碎知识
  15. JavaScript夯实基础系列(一):词法作用域
  16. Oracle入门之对表内容的dml操作
  17. Jenkins系列之四——设置邮件通知
  18. 完美解决office2013 错误1402
  19. Redis学习资料整理
  20. Global.asax中使用HttpContext为空

热门文章

  1. C语言之参数传递
  2. shell 删除文件下的* (copy).jpg备份文件
  3. 如何查看ubuntu下显卡驱动是否已经成功安装
  4. Entity Framework 自动生成CodeFirst代码
  5. nginx负载均衡 加权轮询和ip_hash
  6. 小白科普之JavaScript的JSON
  7. cocos2d 如何优化内存使用
  8. Coursera台大机器学习课程笔记15 -- Three Learning Principles
  9. 详解HttpURLConnection
  10. Tomcat打包时多项目共享jar和精确指定jar版本