How to send data to another .ctp view file from controller


Write something like the bellow code in your controller.

class TestController extends AppController {

public function test() {
  $this->autoRender = false;
  $this->set('data', $this->Model->find('all'));
  $this -> render(`/Controller/index`);
  }
}
Advertisements

Pagination of cakephp


1. Digital Pagination:

<?php echo $this->Paginator->first(__('First', true), array('class' => 'disabled'));?>
|     <?php echo $this->Paginator->prev('<< ' . __('Previous', true), array(), null, array('class'=>'disabled'));?>
|     <?php echo $this->Paginator->numbers(array('class' => 'numbers', 'first' => false, 'last' => false));?>
|     <?php echo $this->Paginator->next(__('Next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
|     <?php echo $this->Paginator->last(__('Last', true), array('class' => 'disabled'));?>

2. Alphabetical Pagination: