,设置分页容器参考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>

laraver ajax分页的更多相关文章

  1. [jQuery]jQuery DataTables插件自定义Ajax分页实现

    前言 昨天在博客园的博问上帮一位园友解决了一个问题,我觉得有必要记录一下,万一有人也遇上了呢. 问题描述 园友是做前端的,产品经理要求他使用jQuery DataTables插件显示一个列表,要实现分 ...

  2. ThinkPHP 整合Bootstrap Ajax分页

    ThinkPHP Ajax分页代码 publicfunction index() { $where=array(); $name = I('name'); if(!empty($name)){ $wh ...

  3. yii2的分页和ajax分页

    要想使用Yii分页类第一步:在控制器层加载分页类 use yii\data\Pagination;第二步: 使用model层查询数据,并用分分页,限制每页的显示条数$data = User::find ...

  4. [js开源组件开发]ajax分页组件

    ajax分页组件 我以平均每一周出一个开源的js组件为目标行动着,虽然每个组件并不是很庞大,它只完成某一个较小部分的工作,但相信,只要有付出,总会得到回报的.这个组件主要完成分页的工作. 这张图里显示 ...

  5. MvcPager 概述 MvcPager 分页示例 — 标准Ajax分页 对SEO进行优化的ajax分页 (支持asp.net mvc)

    该示例演示如何使用MvcPager最基本的Ajax分页模式. 使用AjaxHelper的Pager扩展方法来实现Ajax分页,使用Ajax分页模式时,必须至少指定MvcAjaxOptions的Upda ...

  6. MVC - 11(下)jquery.tmpl.js +ajax分页

    继续 mvc-11(上).dto:http://www.cnblogs.com/tangge/p/3840060.html jquery.tmpl.js 下载:http://pan.baidu.com ...

  7. PHP+jQuery 长文章分页类 ( 支持 url / ajax 分页方式 )

    /* ******* 环境:Apache2.2.8 ( 2.2.17 ) + PHP5.2.6 ( 5.3.3 ) + MySQL5.0.51b ( 5.5.8 ) + jQuery-1.8 **** ...

  8. PHP+jQuery 列表分页类 ( 支持 url 分页 / ajax 分页 )

    /* ******* 环境:Apache2.2.8 ( 2.2.17 ) + PHP5.2.6 ( 5.3.3 ) + MySQL5.0.51b ( 5.5.8 ) + jQuery-1.8.3.mi ...

  9. php--yii框架中的ajax分页与yii框架自带的分页

    要想使用Yii分页类 第一步:在控制器层加载分页类 use yii\data\Pagination; 第二步: 使用model层查询数据,并用分分页,限制每页的显示条数 $data = Zhao::f ...

随机推荐

  1. hdu 2199 Can you solve this equation?

    #include<stdio.h> #include<math.h> double f(double x) { return 8*x*x*x*x+7*x*x*x+2*x*x+3 ...

  2. innerText在谷歌、火狐浏览器下的使用

    使用innerHTML.replace(/<.+?>/gim,'')代替innerText,简单正则替换一下

  3. php-5.3 zend opcache 的设置

    故障现象,修改了代码上传到生产服务器之后,需要等待60秒才生效. 细查了一下,是opcache引起的,默认是60秒.于是我给关了,之前是ea加速,现在新版本的php好像用这个opcache了:; 2s ...

  4. 连接ssql语句

  5. PDP 有多种定义,具体哪一种还需研究!!!!

    PDP (用户面进行隧道转发的信息的保存协议) 编辑 本词条缺少名片图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧! 即PDP上下文,保存用户面进行隧道转发的所有信息,包括RNC/GGSN的 ...

  6. PHP: Local 和 Global 作用域

    函数之外声明的变量拥有 Global 作用域,只能在函数以外进行访问. 函数内部声明的变量拥有 LOCAL 作用域,只能在函数内部进行访问. 下面的例子测试了带有局部和全局作用域的变量: 在上例中,有 ...

  7. 3月23.CSS表格布局

    360表格布局: CSS定义标签: @charset "utf-8";/* CSS Document */.bt1{ border:#309 solid 1px; height:1 ...

  8. poj1012.Joseph(数学推论)

    Joseph Time Limit: 1 Sec  Memory Limit: 64 MB Submit: 493  Solved: 311 Description The Joseph's prob ...

  9. Ubuntu 开机自启动工具 update-rd.d 使用详解

    常用命令: $ sudo update-rc.d nginx defaults      #增加服务 $ sudo update-rc.d -f nginx remove    #移除服务 Linux ...

  10. hibernate中几个接口作用

    1.Configuration 类 Configuration 类负责管理 Hibernate 的配置信息,包括数据库的URL.用户名.密码.JDBC驱动类,数据库Dialect,数据库连接池等,其加 ...