FYI
this is how cake tests the page
if ($page === 'last' || $page >= $pageCount) {
$options['page'] = $page = $pageCount;
} elseif (intval($page) < 1) {
$options['page'] = $page = 1;
}
so i would say 'last' is built in option
On Mon, Apr 18, 2011 at 4:38 PM, lucas <[email protected]> wrote:
> Thanks stats kim, i already know about that solution. It seems there
> is nothing built in at core level to achieve this.
> It´s not an elegant solution but it works fine and it´s practical.
>
> For those who need something like this, before call the paginate
> method, put this line $this->paginate['page'] = 99999; or a bigger
> number...
>
> Thanks for all the responses.
>
>
>
> On 18 abr, 17:23, stas kim <[email protected]>
> wrote:
>> What you can do is set page parameter in your controller to 'last'
>> or some huge number larger than projected page count.
>> And it will miraculously bring you to the last page. whatever that
>> last page's number is.
>> That is the way Controller::paginate works in 1.3
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Apr 18, 2011 at 3:42 PM, lucas <[email protected]> wrote:
>> > I can´t do that because the data can´t be ordered. I need it in that
>> > way...
>>
>> > On 18 abr, 16:37, Tilen Majerle <[email protected]> wrote:
>> >> yes...instead of order => "YourModel.field ASC" type "YourModel.field
>> >> DESC"
>> >> and you will have newest posts/whatever in top of pages
>> >> --
>> >> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>>
>> >> 2011/4/18 Jeremy Burns | Class Outfit <[email protected]>
>>
>> >> > Sort the data in reverse order?
>>
>> >> > Jeremy Burns
>> >> > Class Outfit
>>
>> >> > [email protected]
>> >> >http://www.classoutfit.com
>>
>> >> > On 18 Apr 2011, at 20:32, lucas wrote:
>>
>> >> > > Hi people, is it possible to set as default the last page of the
>> >> > > paginated data from the controller? Is there an option available to do
>> >> > > this?
>>
>> >> > > thanks in advance!
>>
>> >> > > --
>> >> > > Our newest site for the community: CakePHP Video Tutorials
>> >> >http://tv.cakephp.org
>> >> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
>> >> > others with their CakePHP related questions.
>>
>> >> > > To unsubscribe from this group, send email to
>> >> > > [email protected] For more options, visit this
>> >> > > group
>> >> > athttp://groups.google.com/group/cake-php
>>
>> >> > --
>> >> > Our newest site for the community: CakePHP Video Tutorials
>> >> >http://tv.cakephp.org
>> >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
>> >> > others with their CakePHP related questions.
>>
>> >> > To unsubscribe from this group, send email to
>> >> > [email protected] For more options, visit this group
>> >> > athttp://groups.google.com/group/cake-php
>>
>> > --
>> > Our newest site for the community: CakePHP Video
>> > Tutorialshttp://tv.cakephp.org
>> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>> > others with their CakePHP related questions.
>>
>> > To unsubscribe from this group, send email to
>> > [email protected] For more options, visit this group
>> > athttp://groups.google.com/group/cake-php
>
> --
> 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
> [email protected] For more options, visit this group at
> http://groups.google.com/group/cake-php
>
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php