Skip to content

Instantly share code, notes, and snippets.

@marcincodes
Created November 13, 2013 20:25
Show Gist options
  • Save marcincodes/7455766 to your computer and use it in GitHub Desktop.
Save marcincodes/7455766 to your computer and use it in GitHub Desktop.
//debug
array(
(int) 0 => array(
'Theard' => array(
'id' => '1',
'name' => 'Pierwszy post testowy 1',
'slug' => 'pierwszy-post-testowy-1',
'body' => 'body',
'by' => 'PerfectM',
'date' => '2013-10-17 12:31:48',
'views' => '100',
'responses' => '1',
'forum' => '1'
),
'Post' => array(
(int) 0 => array(
'id' => '3',
'name' => 'Pierwszy post testowy 1',
'body' => 'body',
'by' => 'PerfectM 1',
'date' => '2013-12-10 07:36:20',
'theard' => '1'
)
)
)
)
//paginacja
$this->Paginator->settings = array(
'contain' => array(
'Post' => array(
'limit' => 1,
'order' => 'Post.date desc'
)
),
'conditions' => array('Theard.id' => $id)
);
//Wykonanie paginacji
$theard = $this->Paginator->paginate('Theard');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment