paginate problem

2009-03-12 Thread kaushik

How to set conditions and order by in paginate() method of
AppController?
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate problem

2009-03-12 Thread Miles J

Your question is kind of vague.

http://book.cakephp.org/view/165/Controller-Setup

Im not sure you can set $paginate values in the AppController.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



result from paginate problem

2008-04-16 Thread leo

Now, I don't know whether paginate is to blame, I suspect not. Before
I continue, some system stats:

 Local  Remote
PHP: 5.2.5   5.2.5
MySql:   5.0.51 5.0.45
Apache: 2.2.6   1.3.41

Yep, there's a big difference in the Apache version, but I can't
really see it being the problem here.

Code versions - I have just uploaded the full development source to
the server, including the cake directory. the only files that differ
are the database and core files (which differs only in lines defining
Google maps key and Recaptcha keys.

Database versions - the table is actually a view. I have just dropped
and recreated the view from the dev server version.

Code fragment -

157:$results = $this-paginate('Vcas',$conditions);
158:$vcass = array();
159:debug ($results);
160:   foreach($results as $result) :
161:$vcass[$result['Vcas']['cas_id']] = $result;
162:endforeach;

Error message -
Notice (8): Undefined index:  Vcas [APP/controllers/
gestiona_controller.php, line 161]

Debug output - the first one is local and is correct. The second one,
from the remote server, appears to fail to create an associative array
for the Vcas view.

Local:

Array
(
[0] = Array
(
[Vcas] = Array
(
[cas_id] = 00117
[cas_nom] =
[cas_created] = 2008-04-16 11:42:10
[estat_cas_nom] = Actiu
[pagw_nom] = Tasques especials de manteniment


Remote:

Array
(
[0] = Array
(
[0] = Array
(
[cas_id] = 00056
[cas_nom] =
[cas_created] = 2008-04-16 14:06:42
[estat_cas_nom] = Actiu
[pagw_nom] = Tasques especials de manteniment


I'm stumped. If anyone can offer some pointers or solutions, I'd be a
happy man. All other things being equal, the finger seems to be
pointing at Apache, but I just can't see it myself.

Leo
--~--~-~--~~~---~--~~
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: paginate() problem in 1.2.0.4206

2007-02-01 Thread sokol



Jonathon Davis-2 wrote:
 
 
 I am having problems getting pagination working correctly for me in
 1.2.0.4206
 
 In the view I have this to display the Prev and Next controls for the
 user: ?php echo $this-prev().' '.$this-next(); ?
 
 It correctly displays the default page, and page 2 when the Next link
 is clicked, but after you've clicked one link, the Next and Prev links
 are messed up. They show up like this:
 http://localhost/cake/admin/graphics/index/page:3page:3 which is
 obviously not correct, and it always just shows the 1st page if a link
 like that (with the page in there twice). Any way to fix this?
 


I'm having the same problem with $paginator-next() and -prev();
Looking inside the cake's code I found the solution:

remove or comment line line 445 in the file /cake/libs/router.php

$combined = '';
if (!empty($path['namedArgs'])) {
$count = count($named);
for ($i = 0; $i  $count; $i++) {
$named[$i] = join($path['argSeparator'], $named[$i]);
}

THIS LINE SHOULD BE COMMENTED//$combined = join('/', $named);
}

I don't know what this line does, but broblem is fixed ;) I also tested
combined arguments, seems to be everything is ok!

Best regards!
-- 
View this message in context: 
http://www.nabble.com/paginate%28%29-problem-in-1.2.0.4206-tf3065637.html#a8741930
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

I am having problems getting pagination working correctly for me in
1.2.0.4206

I have $helpers = array('Paginator') in my controller.

I set the value for the view with $this-set('graphics',
$this-paginate());

In the view I have this to display the Prev and Next controls for the
user: ?php echo $this-prev().' '.$this-next(); ?

It correctly displays the default page, and page 2 when the Next link
is clicked, but after you've clicked one link, the Next and Prev links
are messed up. They show up like this:
http://localhost/cake/admin/graphics/index/page:3page:3 which is
obviously not correct, and it always just shows the 1st page if a link
like that (with the page in there twice). Any way to fix this? Should I
grab a nightly build to see if it's fixed there? or what?


--~--~-~--~~~---~--~~
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: paginate() problem in 1.2.0.4206

2007-01-23 Thread dkarlson

You don't need to set the $helpers = array('Paginator'), it gets pulled
in when $this-paginate() is used.

In my view, I use echo $paginator-prev('Previous', null, null,
array('class' = 'disabled'));  for the prev  next links.

Does this help? There's also this from nate that might help.
http://cake.insertdesignhere.com/posts/view/16

D

On Jan 23, 11:01 am, Jonathon Davis [EMAIL PROTECTED] wrote:
 I am having problems getting pagination working correctly for me in
 1.2.0.4206

 I have $helpers = array('Paginator') in my controller.

 I set the value for the view with $this-set('graphics',
 $this-paginate());

 In the view I have this to display the Prev and Next controls for the
 user: ?php echo $this-prev().' '.$this-next(); ?

 It correctly displays the default page, and page 2 when the Next link
 is clicked, but after you've clicked one link, the Next and Prev links
 are messed up. They show up like 
 this:http://localhost/cake/admin/graphics/index/page:3page:3which is
 obviously not correct, and it always just shows the 1st page if a link
 like that (with the page in there twice). Any way to fix this? Should I
 grab a nightly build to see if it's fixed there? or what?


--~--~-~--~~~---~--~~
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: paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

Problem resolved. Although I wanted to be sure that I was using the
most stable development release out there, I decided to try the nightly
build and it fixed the issue. Upgraded from version 1.2.0.4206 to
1.2.x.x_22.01.2007


--~--~-~--~~~---~--~~
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: paginate() problem in 1.2.0.4206

2007-01-23 Thread nate

Yeah, issues are fixed on a pretty regular basis.  If you're using the
dev version of Cake (i.e. 1.2), it's best to stay with the nightlies.


--~--~-~--~~~---~--~~
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: paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

Gotcha thanks.

I have a question about pagination though. Is there a way to filter
paginated results? For example, if I only wanted to fetch and paginate
a certain category of posts, can I do that with the built-in function
or will I have to rely on the findAll function?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---