PHP code example of seblhaire / bootstrappaginator

1. Go to this page and download the library: Download seblhaire/bootstrappaginator 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/ */

    

seblhaire / bootstrappaginator example snippets


  'providers' => [
    ...
      Seblhaire\BootstrapPaginator\BootstrapPaginatorServiceProvider::class,
      ...
    ],
    'aliases' => [
        ...
        'BootstrapPaginator' => Seblhaire\BootstrapPaginator\BootstrapPaginator::class,
      ]

config('bootstrappaginator')
 sh
$ php artisan vendor:publish

function issues($page = 1){ ...}

public function authors($initial = config('bootstrappaginator.valueforall')){ ... }

Route::get('/authors/{initial?}/{page?}', 'MainController@authors')->name('authors');

public function authors($initial = null, $page =1){
  ....
   $initial = is_null($initial) ? config('bootstrappaginator.valueforall') : $initial;
   $route = 'authors';
   $options = ['nbpages' => 4, 'params' => ['initial' => $initial]];
   $optionalpha = ['type' => 'alpha'];
   $paginator = BootstrapPaginator::init($page, $route, $options);
   $paginatoralpha = BootstrapPaginator::init($initiale, $route, $optionalpha);
   ....
   return view('pages.authors', [
       ...
       'paginator' => $paginator,
       'paginatoralpha' => $paginatoralpha,
       ...
  ]);
}