PHP code example of landish / pagination

1. Go to this page and download the library: Download landish/pagination library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

landish / pagination example snippets


{!! (new Landish\Pagination\SemanticUI($items))->render() !!}
// or add "\Simple" in namespace for "Simple Pagination"
{!! (new Landish\Pagination\Simple\SemanticUI($items))->render() !!}

{!! (new Landish\Pagination\ZurbFoundation($items))->render() !!}
// or add "\Simple" in namespace for "Simple Pagination"
{!! (new Landish\Pagination\Simple\ZurbFoundation($items))->render() !!}

{!! (new Landish\Pagination\UIKit($items))->render() !!}
// or add "\Simple" in namespace for "Simple Pagination"
{!! (new Landish\Pagination\Simple\UIKit($items))->render() !!}

{!! (new Landish\Pagination\Materialize($items))->render() !!}
// or add "\Simple" in namespace for "Simple Pagination"
{!! (new Landish\Pagination\Simple\Materialize($items))->render() !!}

 namespace App;

use Landish\Pagination\SemanticUI;

// Uncomment bellow line, if you like to use "Simple Pagination"
// use Landish\Pagination\Simple\SemanticUI;

class Pagination extends SemanticUI {

}

{!! (new App\Pagination($items))->render() !!}

$items = User::where('votes', '>', 100)->simplePaginate(15);

{!! (new Landish\Pagination\Simple\ZurbFoundation($items))->render() !!}

@if($items->hasPages())
	<div class="pagination-wrapper">
    	<div class="pagination-wrapper-inner">
        	{!! (new App\Pagination($items))->render() !!}
        </div>
	</div>
@endif

{!! $items->appends(['key' => 'value'])->render(new App\Pagination($items))  !!}

 namespace Landish\Pagination;

class PaginationHTML {

    /**
     * Pagination wrapper HTML.
     *
     * @var string
     */
    protected $paginationWrapper = '<ul class="pagination">%s %s %s</ul>';

    /**
     * Available page wrapper HTML.
     *
     * @var string
     */
    protected $availablePageWrapper = '<li><a href="%s">%s</a></li>';

    /**
     * Get active page wrapper HTML.
     *
     * @var string
     */
    protected $activePageWrapper = '<li class="active"><span>%s</span></li>';

    /**
     * Get disabled page wrapper HTML.
     *
     * @var string
     */
    protected $disabledPageWrapper = '<li class="disabled"><span>%s</span></li>';

    /**
     * Previous button text.
     *
     * @var string
     */
    protected $previousButtonText = '&laquo;';

    /**
     * Next button text.
     *
     * @var string
     */
    protected $nextButtonText = '&raquo;';

    /***
     * "Dots" text.
     *
     * @var string
     */
    protected $dotsText = '...';
    
    ...
    
    }

 namespace App;

use Landish\Pagination\Pagination as BasePagination;

class Pagination extends BasePagination {
	
	/**
     * Pagination wrapper HTML.
     *
     * @var string
     */
	protected $paginationWrapper = '<ol class="pagination-extended-css-class">%s %s %s</ol>';
	
	...
}

{!! (new App\Pagination($items))->render() !!}