Re: Paginate an array

2011-12-28 Thread Sam Sherlock
You need to add ); to the end of the line where you call $this->paginate() In php lines end in semi-colons You'll find it helpful if you can setup an editor that matches braces and brackets, code hinting & code completion Many editors have such features - Google to get the info. - S On 28 Dec 20

Re: Paginate an array

2011-12-28 Thread J.
Yes, figured out On 28 déc, 12:55, Tilen Majerle wrote: >  public function index() { >        var $paginate = array( >            'limit' => 5, >            'order' => array( >                'id' => 'asc' >            ) >        ); >        $this->set('items', $this->paginate('Item') >    } > >

Re: Paginate an array

2011-12-28 Thread Tilen Majerle
public function index() { var $paginate = array( 'limit' => 5, 'order' => array( 'id' => 'asc' ) ); $this->set('items', $this->paginate('Item') } how can this works ?? :D "var" inside method ? :) -- Lep pozdrav, Tilen Majerle

Re: Paginate an array

2011-12-28 Thread J.
Found it. Seems my paginators were deprecated. I used this : Paginator->numbers(); ?> Moreover, the VAR had to be declared before the functions. On 28 déc, 12:29, "J." wrote: > Here is my controller : > > class ItemsController extends AppController { >     public $name = 'Items'; >     public

Re: Paginate an array

2011-12-28 Thread J.
Here is my controller : 5, 'order' => array( 'id' => 'asc' ) ); $this->set('items', $this->paginate('Item') } and I have this in my view : prev(); ?> numbers(); ?> next(); ?> And I get this error message : Parse error: syntax erro

Re: Paginate an array

2011-12-26 Thread Tilen Majerle
or for 2.0 this: http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/12/26 euromark > you are probably looking for > http://book.cakephp.org/view/1231/Pagination > > > On 26 Dez., 17:40, "J." wrote: > > People here are

Re: Paginate an array

2011-12-26 Thread euromark
you are probably looking for http://book.cakephp.org/view/1231/Pagination On 26 Dez., 17:40, "J." wrote: > People here are of great help, so I figured out I may ask here. > > I have an Item controller (An Item is a post on my website) with this > function : > >     public function index() { >  

Re: Paginate an array

2011-12-26 Thread Tilen Majerle
http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/12/26 J. > People here are of great help, so I figured out I may ask here. > > I have an Item controller (An Item is a post on my website) with this > function : > >pub

Paginate an array

2011-12-26 Thread J.
People here are of great help, so I figured out I may ask here. I have an Item controller (An Item is a post on my website) with this function : public function index() { $this->set('items', $this->Item->find('all', array('limit' => 5 ))); } When in view, I echo it out this like

Re: Paginate an array?

2011-04-07 Thread euromark
essage- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf > > Of heohni > Sent: Thursday, April 07, 2011 12:15 PM > To: CakePHP > Subject: Re: Paginate an array? > > Hi, > > I need to push this up, I still get in trouble with it. > >

RE: Paginate an array?

2011-04-07 Thread Krissy Masters
: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of heohni Sent: Thursday, April 07, 2011 12:15 PM To: CakePHP Subject: Re: Paginate an array? Hi, I need to push this up, I still get in trouble with it. I select all my members with a find call: $getMembers = $this->Memb

RE: Paginate an array?

2011-04-07 Thread Krissy Masters
K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of heohni Sent: Thursday, April 07, 2011 12:15 PM To: CakePHP Subject: Re: Paginate an array? Hi, I need to push this up, I still get in trouble with it. I select all my members with a

Re: Paginate an array?

2011-04-07 Thread heohni
sage- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf > > Ofheohni > Sent: Friday, April 01, 2011 10:50 AM > To: CakePHP > Subject: Paginate an array? > > Hi, > > I have a find() function to get some data. > The user has the chance to

RE: Paginate an array?

2011-04-01 Thread Krissy Masters
ailto:cake-php@googlegroups.com] On Behalf Of heohni Sent: Friday, April 01, 2011 10:50 AM To: CakePHP Subject: Paginate an array? Hi, I have a find() function to get some data. The user has the chance to modfiy the data and all changes I keep in an array. Can I also give that array to the pagin

Paginate an array?

2011-04-01 Thread heohni
Hi, I have a find() function to get some data. The user has the chance to modfiy the data and all changes I keep in an array. Can I also give that array to the paginate function? As I want to paginate through the users custom made data and not the original DB result? Any ideas on that? Thanks and

Re: Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread DavidH
Yes I looked at the custom query pagination; but the reason that is no good is in the title 'query'. I'm not doing a query on a database I've already got my data set that I want to paginate. Well I guess the custom query pagination is the way to go in that I'll have to override the existing pagin

Re: Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread Dr. Loboto
You can try custom query pagination. http://book.cakephp.org/view/249/Custom-Query-Pagination On Sep 6, 11:53 pm, DavidH wrote: > Hi > > I'm using CakePHP as a development framework; but my data is stored / > retrieved in documents from a Couch DB. I've written home grown > classes to access th

Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread DavidH
Hi I'm using CakePHP as a development framework; but my data is stored / retrieved in documents from a Couch DB. I've written home grown classes to access the Couch and have turned off Cake's desire for a DBMS by creating my own dbo_source that just returns true making Cake think it's connected O

Re: Paginate an array thats not from a model

2008-01-21 Thread Johan @ Notitia.nl
Hi Chris, Here's a simple solution I use for myself (I don't use XML, but I use it for a search function) $xmlData = [read the xmlfeed and return it as an array] /* run through the array */ foreach($xmlData as $key => $val) { /* the value will be sortable by the key */ $this->pagination[$

Re: Paginate an array thats not from a model

2008-01-18 Thread Chris Hartjes
On Jan 18, 2008 1:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Why are you using MVC if you aren't making models? It's not about not using models, it's about using non-database powered models. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handl

Re: Paginate an array thats not from a model

2008-01-18 Thread Arne-Kolja Bachstein
@rtconner: Thanks, I'll take a look at this. @Michael: The project is much bigger, that's just one tricky part of it. On 18 Jan., 19:54, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 18, 12:38 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote: > > > Hi there, > > > does anyone know if

Re: Paginate an array thats not from a model

2008-01-18 Thread [EMAIL PROTECTED]
On Jan 18, 12:38 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote: > Hi there, > > does anyone know if there is a chance to paginate data thats not > fetched from the database/a model using the paginator component or > something? > > The situation: I have a search form that fetches its hits fr

Re: Paginate an array thats not from a model

2008-01-18 Thread rtconner
I guess you could overwrite the paginate() and paginateCount() methods in the model. On Jan 18, 10:38 am, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote: > Hi there, > > does anyone know if there is a chance to paginate data thats not > fetched from the database/a model using the paginator compon

Paginate an array thats not from a model

2008-01-18 Thread Arne-Kolja Bachstein
Hi there, does anyone know if there is a chance to paginate data thats not fetched from the database/a model using the paginator component or something? The situation: I have a search form that fetches its hits from an XML file. That's done by first fetching the XML file, saving it to the tmp fo