Skip to content

Instantly share code, notes, and snippets.

@azrad
Last active December 10, 2015 22:08
Show Gist options
  • Save azrad/4499341 to your computer and use it in GitHub Desktop.
Save azrad/4499341 to your computer and use it in GitHub Desktop.
the Controller and View for custom find type
<?php
// the Controller
class EnquiriesController extends AppController {
function junk() {
$this->paginate = array('junk');
$this->set('junk', $this->paginate());
}
}
<!-- the View -->
<?php foreach($junk as $mail):?>
<p><?php echo h($mail['Enquiry']['subject'])?> by <?php echo h($mail['Enquiry']['email'])?> <?php echo $this->Html->link('reply', array('action' => 'reply', $mail['Enquiry']['id']))?></p>
<?php endforeach?>
<?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}')
));
?> </p>
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('< ' . __('previous'), array('tag' => 'li'), null, array('class' => 'prev disabled', 'tag' => 'li'));
echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li'));
echo $this->Paginator->next(__('next') . ' >', array('tag' => 'li'), null, array('class' => 'next disabled', 'tag' => 'li'));
?>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment