PHP code example of iscosta77 / gallery

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

    

iscosta77 / gallery example snippets


use Hermes\Gallery\Gallery;

$galeria = new Gallery(__DIR__ . '/fotos');          // pasta com as imagens
$imagens = $galeria->imagens();                       // lista ordenada
$total   = $galeria->total();                         // contagem
$pagina  = $galeria->pagina(1, 12);                   // fatia p/ paginação

echo $galeria->grade($imagens);                       // HTML da grade
bash
composer install
php -S localhost:8000 -t vendor/iscosta77/gallery/exemplo