Last active
December 10, 2015 22:08
-
-
Save azrad/4499341 to your computer and use it in GitHub Desktop.
the Controller and View for custom find type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// the Controller | |
class EnquiriesController extends AppController { | |
function junk() { | |
$this->paginate = array('junk'); | |
$this->set('junk', $this->paginate()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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