<div class="container">
    <div class="col-md-12">
                <?php 
                $i=1;
                foreach ($listings as $listing): 
                    ?>
        <div class="col-md-2">
                  
                <?= $this->Html->image(Cake\Core\Configure::read('IMAGE_PREPATH', '') . $listing->image_path, ['id' => 'image',  'class' => 'img-responsive']) ?>

                <p><?=$listing->name?></p> 
      
                  
                  <span class="pull-right">
                              <?php

                             if(in_array($listing->status, [0,2,99])){ 
                                    echo $this->Html->link(__('Enable '), ['controller'=>'Gallery','action' => 'enable',$listing->id]); 
                                    
                                } 
                                else if($listing->status == 1){ 
                                    echo $this->Html->link(__('Disable '), ['controller'=>'Gallery','action' =>'disable',$listing->id]); 
                                }                                                       
                              echo " | ";
                              echo $this->Html->link(__("Remove"), ['controller'=>'Gallery', 'action' => 'remove', $listing->id]) ;
                          
                            ?>
                             
                   </span> 
                   
            </div>   
                <?php

if($i%6==0){ echo '<div style="clear:both"></div>';}
  $i++;
                 endforeach; ?>
           
    </div>

     <div class="row">
  <div class="col-sm-12">
    <!-- <div class="paginator" style="text-align: center;">
      <ul class="pagination">
        <?= $this->Paginator->prev('< ' . __('prev')) ?>
        <?= $this->Paginator->numbers(['first' => 3, 'last' => 3, 'modulus' => 4]) ?>
        <?= $this->Paginator->next(__('next') . ' >') ?>
      </ul>
      <p><?= $this->Paginator->counter() ?></p>
    </div> -->
  </div>
</div>
</div>