2016-04-10 13 views
-1

= bu benim endeksidirCakePHP'de sayfalandırma kontrolörü i denetleyicisi yazmak shoud

<?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-> prev (' < < Önceki, null, null, array ('sınıf' pagiation olması > 'devre dışı')); echo $ this-> Paginator-> numbers(); echo $ this-> Paginator-> next ('Next >>', null, null, array ('class' => 'disabled')); ?>

cevap

0

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

$ this-> set ('data', $ data); i $ [ 'Servicebien'] bien çünkü

+0

bu morina deneyin – wah

0

çalışmıyor bu

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(); 
    } 
}