Tuesday, September 16, 2008

Re: multiple model

To paginate anything but the first defined model you need to let
Paginator know which one you want.
Check out the Pagination chapter in the book.
http://book.cakephp.org/view/165/Controller-Setup


On Sep 15, 3:03 pm, nayan <lodhana...@gmail.com> wrote:
> i have wrote the following code to use mulitple model
> class AutoLinkExchangesController extends AppController {
>         var $name = 'AutoLinkExchanges';
>           var $uses=array('AutoLinkExchange','AutoHyperLink');
>
> function admin_autohyperlink_index(){
>
>   if(!empty($this->data))
>          {
>                 $criteria=NULL;
>          list($order,$limit,$page) = $this->Pagination->init($criteria);
>         $data = $this->AutoHyperLink->findAll($criteria, NULL, $order,
> $limit, $page);
>
>         }
>
> it shows me the queryu with "ORDER BY `AutoLinkExchange`.`id` " but i
> am using AutoHyperLink model
> and one more thing when i change the position of model in uses like
>  var $uses=array('AutoHyperLink','AutoLinkExchange');
> then it does not show me any error and both model do not have any
> relation.
> Plz suggest me the solution......
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: