Guest User

Untitled

a guest
May 25th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. // in my AppController
  2.  
  3. public function beforeFilter() {
  4.  
  5.         $this->set('totalSubmissions', $this->getSubmissionCount());
  6. }
  7.  
  8.     public function getSubmissionCount() {
  9.         $totalSubmissions = $this->Submission->find('count');
  10.         return $totalSubmissions;
  11.     }
  12.  
  13. // in my app/views/elements/sidebar_categories.ctp (which is called in app/views/default.ctp)
  14.  
  15. <?= $totalSubmissions; ?>
Add Comment
Please, Sign In to add comment