Sunday, November 13, 2011

Re: How to paginate "subtable" in a view?

On Nov 13, 11:01 am, phpMagpie <p...@webbedit.co.uk> wrote:
> You can't paginate data you have fetched with $this->Model->find() you
> must use $this->paginate().
>
> HTH, Paul.

OK, here is what I tried:

$this->set(
'category',
$this->paginate(
$this->Category->find(
'first',
array(
'conditions' => array('Category.id' => $id),
'contain' => array(
'Post' => array(
'User' => array(
'id',
'username'
)
)
)
)
)
)
);

I now get these errors:

Notice (8) : Array to string conversion [CORE\cake\libs\model
\datasources\dbo_source.php, line 2204]
Warning (512) : SQL Error: 1054: Unknown column 'Category' in 'where
clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 684]

What am I doing wrong?

Thanks.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate