Re: Using pagination helper on a view element
Not sure of this, but I did used it at the beginning of 1.2: $lview= ClassRegistry::getObject('view'); $paginator = $lview->loaded['paginator']; Really not sure that will work.. hth On Jun 24, 11:47 am, bob <[EMAIL PROTECTED]> wrote: > Anyone have an answer to this problem? > > Thanks > > On Apr 7, 7:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > I'm trying to make a view element and reuse it in various views. The > > element uses the pagination helper, the problem is that the element > > can't see the paginator helper object: > > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > > If I add the helper to the "uses" variable of the controller which > > calls the action that includes the element on its view, then the > > helper is found but I get these errors: > > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > > The code of my element is something like the the following: > > > $servers = $this->requestAction('servers/index/'); > > ?> > > > > > > sort('Server Name', 'name');?> > > sort('IP Address', 'ip_address');?> > > > > > > > > > > > > > > > > > > prev('<< Previous ', null, null);?> > > next(' Next >>', null, null);?> > > '.$paginator->counter(); ?> > > div(null,$paginate, array('align' => 'center')); ?> > > > on the view that includes it: > > > echo $this->renderElement('servers'); > > > and the controller action: > > > function index($id = null) { > > $servers = $this->paginate('Server'); > > $this->set(compact('servers')); > > if(isset($this->params['requested'])) { > > return $servers; > > } > > > } > > > So how is the propper way to use the pagination helper on a view element ? > > > Thanks. > > -- > > Juan Luis Baptiste --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
Anyone have an answer to this problem? Thanks On Apr 7, 7:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to make a view element and reuse it in various views. The > element uses the pagination helper, the problem is that the element > can't see the paginator helper object: > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > If I add the helper to the "uses" variable of the controller which > calls the action that includes the element on its view, then the > helper is found but I get these errors: > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > The code of my element is something like the the following: > > $servers = $this->requestAction('servers/index/'); > ?> > > > sort('Server Name', 'name');?> > sort('IP Address', 'ip_address');?> > > > > > > > > > prev('<< Previous ', null, null);?> > next(' Next >>', null, null);?> > '.$paginator->counter(); ?> > div(null,$paginate, array('align' => 'center')); ?> > > on the view that includes it: > > echo $this->renderElement('servers'); > > and the controller action: > > function index($id = null) { > $servers = $this->paginate('Server'); > $this->set(compact('servers')); > if(isset($this->params['requested'])) { > return $servers; > } > > } > > So how is the propper way to use the pagination helper on a view element ? > > Thanks. > -- > Juan Luis Baptiste --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
Can I add to this and say "ditto"? On Apr 7, 10:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to make a view element and reuse it in various views. The > element uses the pagination helper, the problem is that the element > can't see the paginator helper object: > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > If I add the helper to the "uses" variable of the controller which > calls the action that includes the element on its view, then the > helper is found but I get these errors: > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > The code of my element is something like the the following: > > $servers = $this->requestAction('servers/index/'); > ?> > > > sort('Server Name', 'name');?> > sort('IP Address', 'ip_address');?> > > > > > > > > > prev('<< Previous ', null, null);?> > next(' Next >>', null, null);?> > '.$paginator->counter(); ?> > div(null,$paginate, array('align' => 'center')); ?> > > on the view that includes it: > > echo $this->renderElement('servers'); > > and the controller action: > > function index($id = null) { > $servers = $this->paginate('Server'); > $this->set(compact('servers')); > if(isset($this->params['requested'])) { > return $servers; > } > > } > > So how is the propper way to use the pagination helper on a view element ? > > Thanks. > -- > Juan Luis Baptiste --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
Yeah man! The same error here. It's ocurrs when I try to sort fields of another model. Like: $paginator->sort('Field Description', 'field', array('model' => 'MyModel')) =/ On Wed, Apr 16, 2008 at 8:02 PM, Grainne <[EMAIL PROTECTED]> wrote: > > I am having the exact same problem. I hope someone can help us. > > - Grainne > > On Apr 7, 9:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> > wrote: > > Hi, > > > > I'm trying to make a view element and reuse it in various views. The > > element uses the pagination helper, the problem is that the element > > can't see the paginator helper object: > > > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > > > If I add the helper to the "uses" variable of the controller which > > calls the action that includes the element on its view, then the > > helper is found but I get these errors: > > > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > > > The code of my element is something like the the following: > > > > $servers = $this->requestAction('servers/index/'); > > ?> > > > > > > sort('Server Name', 'name');?> > > sort('IP Address', > 'ip_address');?> > > > > > > > > > > > > > > > > > > prev('<< Previous ', null, > null);?> > > next(' Next >>', null, null);?> > > '.$paginator->counter(); ?> > > div(null,$paginate, array('align' => 'center')); ?> > > > > on the view that includes it: > > > > echo $this->renderElement('servers'); > > > > and the controller action: > > > > function index($id = null) { > > $servers = $this->paginate('Server'); > > $this->set(compact('servers')); > > if(isset($this->params['requested'])) { > > return $servers; > > } > > > > } > > > > So how is the propper way to use the pagination helper on a view element > ? > > > > Thanks. > > -- > > Juan Luis Baptiste > > > -- Renan Gonçalves - Software Engineer Cell Phone: +55 11 8633 6018 MSN: [EMAIL PROTECTED] São Paulo - SP/Brazil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
I am having the exact same problem. I hope someone can help us. - Grainne On Apr 7, 9:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to make a view element and reuse it in various views. The > element uses the pagination helper, the problem is that the element > can't see the paginator helper object: > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > If I add the helper to the "uses" variable of the controller which > calls the action that includes the element on its view, then the > helper is found but I get these errors: > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > The code of my element is something like the the following: > > $servers = $this->requestAction('servers/index/'); > ?> > > > sort('Server Name', 'name');?> > sort('IP Address', 'ip_address');?> > > > > > > > > > prev('<< Previous ', null, null);?> > next(' Next >>', null, null);?> > '.$paginator->counter(); ?> > div(null,$paginate, array('align' => 'center')); ?> > > on the view that includes it: > > echo $this->renderElement('servers'); > > and the controller action: > > function index($id = null) { > $servers = $this->paginate('Server'); > $this->set(compact('servers')); > if(isset($this->params['requested'])) { > return $servers; > } > > } > > So how is the propper way to use the pagination helper on a view element ? > > Thanks. > -- > Juan Luis Baptiste --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using pagination helper on a view element
Hi, I'm trying to make a view element and reuse it in various views. The element uses the pagination helper, the problem is that the element can't see the paginator helper object: : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] If I add the helper to the "uses" variable of the controller which calls the action that includes the element on its view, then the helper is found but I get these errors: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/libs/view/helpers/paginator.php, line 139] The code of my element is something like the the following: $servers = $this->requestAction('servers/index/'); ?> sort('Server Name', 'name');?> sort('IP Address', 'ip_address');?> prev('<< Previous ', null, null);?> next(' Next >>', null, null);?> '.$paginator->counter(); ?> div(null,$paginate, array('align' => 'center')); ?> on the view that includes it: echo $this->renderElement('servers'); and the controller action: function index($id = null) { $servers = $this->paginate('Server'); $this->set(compact('servers')); if(isset($this->params['requested'])) { return $servers; } } So how is the propper way to use the pagination helper on a view element ? Thanks. -- Juan Luis Baptiste --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---