Re: Pagination on cached data?

2009-11-25 Thread AD7six


On 25 nov, 15:17, leberle  wrote:
> > ps ->paginate($somethingMaybeHuge); is IMO a really bad idea/negating
> > the point of pagination
>
> Hm, i'm not sure if i get you rightyou say that it may be a bad
> idea just because the data passed maybe very large? Dont you have the
> same problem if you call paginate with bad settings, e.g. limit
> 123456789?

If you've ever done that, it's called shooting your self in the foot/
not sanitizing user parameters/screwing up :).

> IMHO it's in the responsibility of the developer to take care about
> the size of the passed data...well, whatever, it would be nice to have
> the pagination available for data that doesn't come from a model.

Perhaps I misunderstood your question. I understood you to mean:

$data = cache('some.key');
$abitofdata = $this->paginateorequivalent($data);

I hope you see the problem in doing that. You can't control the size
of $data in such a case,  as you don't know how big it is until you've
recieved it - which may never happen if you run out of memory in the
process.

> Btw: i decided to do the caching in the datasource, so paginate works
> fine as there is no difference in the upper MVC layers.

Cool idea, same principle.

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Pagination on cached data?

2009-11-25 Thread leberle
> ps ->paginate($somethingMaybeHuge); is IMO a really bad idea/negating
> the point of pagination

Hm, i'm not sure if i get you rightyou say that it may be a bad
idea just because the data passed maybe very large? Dont you have the
same problem if you call paginate with bad settings, e.g. limit
123456789?
IMHO it's in the responsibility of the developer to take care about
the size of the passed data...well, whatever, it would be nice to have
the pagination available for data that doesn't come from a model.


Btw: i decided to do the caching in the datasource, so paginate works
fine as there is no difference in the upper MVC layers.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Pagination on cached data?

2009-11-24 Thread AD7six


On 23 nov, 17:25, leberle  wrote:
> Hi dudes,
>
> is there a way to paginate cached data? I wanna cache the result from
> a $controller->paginate() request an use it the next time the page is
> requested. But i've i bind the cached data for the view, i've the
> problem that paginate() wasn't called so the paginate-helper functions
> in the view dont work ("Undefined variable: paginator").
> So i'm looking for something like
> $controller->paginate($my_cached_data);
>
> Does something like that already exist or do i've to write it? :)=

Try putting something like this in your model:
http://bin.cakephp.org/view/192743063

You could do the same with paginateCount so that you don't even need a
db for your paginated data if the cache is populated.

hth,

AD
ps ->paginate($somethingMaybeHuge); is IMO a really bad idea/negating
the point of pagination

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@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.




Pagination on cached data?

2009-11-23 Thread leberle
Hi dudes,

is there a way to paginate cached data? I wanna cache the result from
a $controller->paginate() request an use it the next time the page is
requested. But i've i bind the cached data for the view, i've the
problem that paginate() wasn't called so the paginate-helper functions
in the view dont work ("Undefined variable: paginator").
So i'm looking for something like
$controller->paginate($my_cached_data);

Does something like that already exist or do i've to write it? :)=

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@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=.