2016-04-10 13 views
-1

was shoud i in der Steuerung schreiben haben pagiation dies mein Index istCakePHP Paginierung Controller

<?php foreach ($bien['Servicebien'] as $servicebien): ?> 
       <tr> <td><?php echo $servicebien['dateServiceBienDu']; ?> 
        <td><?php echo $servicebien['dateServiceBien']; ?></td> 
        <td><?php echo $servicebien['montantServiceBien']; ?></td> 


       </tr> 
      <?php endforeach; ?> 
      <?php unset($servicebien); ?> 
      </table> 
      <div> 
<?php echo $this->Paginator->counter(array('format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}'))); ?> 

paginator-> zurück (‘< < Zurück, null, null, array ('class' = > "deaktiviert")); echo $ this-> Paginator-> Nummern(); echo $ this-> Paginator-> next ('Weiter >>', null, null, Array ('Klasse' => 'deaktiviert')); ?>

Antwort

0

$ data = $ this-> Paginator-> paginate ('model_name');

$ this-> set ('data', $ data);

+0

dieses cod nicht arbeiten, weil ich $ bien haben [ 'Servicebien'] – wah

0

Versuchen Sie, diese

class FeedsController extends AppController { 

    public $components = array('Search.Prg'); 

    public function beforeFilter() { 
     parent::beforeFilter(); 
    } 

    function indes(){ 
     $this->Prg->commonProcess(); 

     $this->{$this->modelClass}->data[$this->modelClass]   =  $this->passedArgs; 
     $parsedConditions = $this->{$this->modelClass}->parseCriteria($this->passedArgs); 

     $this->paginate = array(
      'conditions' => array(), 
      'limit'  => 10, 
      'fields' => array(), 
      'order'   => 'id DESC'  
     );   
     $result = $this->paginate(); 
    } 
} 
Verwandte Themen