Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5.3,将分页链接(<;>;>;)替换为图像_Php_Ajax_Laravel_Laravel 5_Pagination - Fatal编程技术网

Php Laravel 5.3,将分页链接(<;>;>;)替换为图像

Php Laravel 5.3,将分页链接(<;>;>;)替换为图像,php,ajax,laravel,laravel-5,pagination,Php,Ajax,Laravel,Laravel 5,Pagination,如何用图像替换自定义laravel分页? 我还希望在不重新加载页面的情况下获取下一组数据。 我的控制器看起来像这样 class HomeController extends Controller { public function index() { $featured_products = DB::table('products') ->where('feature_type','=',3) ->orderBy('cre

如何用图像替换自定义laravel分页? 我还希望在不重新加载页面的情况下获取下一组数据。 我的控制器看起来像这样

class HomeController extends Controller
{
public function index()
{       
        $featured_products = DB::table('products')
        ->where('feature_type','=',3)
        ->orderBy('created_at','DESC')
        ->simplePaginate(4);


        $latest_products = DB::table('products')
        ->orderBy('created_at','DESC')
        ->simplePaginate(4);


        return View::make('pages.home')
         ->with(['featured_products'=>$featured_products,'latest_products'=>$latest_products]);
}
}

在5.3中,您可以

在其他版本中,您可以尝试使用CSS覆盖此选项,也可以尝试替代使用
$results->render()
方法:

$results->count()
$results->currentPage()
$results->firstItem()
$results->hasMorePages()
$results->lastItem()
$results->lastPage() (Not available when using simplePaginate)
$results->nextPageUrl()
$results->perPage()
$results->previousPageUrl()
$results->total() (Not available when using simplePaginate)
$results->url($page)

最简单的方法是编辑分页的
blade
文件

首先,在您的控制台运行中:

php artisan vendor:publish --tag=laravel-pagination
然后转到
resources/views/vendor/pagination/default.blade.php
,您将看到:

@if ($paginator->onFirstPage())
    <li class="disabled"><span>&laquo;</span></li>
@else
    <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a></li>
@endif

...

@if ($paginator->hasMorePages())
    <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a></li>
@else
    <li class="disabled"><span>&raquo;</span></li>
@endif
@if($paginator->onFirstPage())
  • « @否则
  • @恩迪夫 ... @如果($paginator->hasMorePages())
  • @否则
  • » @恩迪夫
  • 您只需更换
    «
    »与要使用的图像

    希望这有帮助