If you are just counting the number of rows returned, just use the php
function count() on your returned dataset.
in your view:
echo count($gallery);
Cheers,
Adam
On Jul 31, 7:12 pm, DrLaban <[EMAIL PROTECTED]> wrote:
> That worked ace! Thanks!
>
> Regard
> DrLaban
>
> On Jul 29, 6:22 pm, Gorka <[EMAIL PROTECTED]> wrote:
>
> > If I understood you right, you are overwritting the value of 'gallery'
> > with the second call to $this->set(), when you wanted to merge both
> > values. Try preparing your data first, then setting 'gallery' for the
> > view.
>
> > $galery = $this->Gallery->findAll();
> > $gallery['numRows'] = $this->Gallery->getNumRows();
> > $this->set('gallery', $gallery);
>
> > On 29 jul, 17:30,DrLaban<[EMAIL PROTECTED]> wrote:
>
> > > Hey all!
>
> > > Short and simple;
> > > I'm trying to add more data to a Controller object with the help of
> > > set().
>
> > > So what I'm doing in practice:
> > > $this->set('gallery', $this->Gallery->findAll());
>
> > > Everything works out fine here. I get access to all the info I need in
> > > the view I'm working with.
> > > Now, I'd like to add something simple like "numRows" to the gallery
> > > variable.
>
> > > What I've tried is:
> > > $this->set('gallery', array('numRows' => $this->Gallery-
>
> > > >getNumRows());
>
> > > But, as it would seem, the gallery object now only contains the last
> > > set function call's info. How do I add info to the gallery object
> > > without losing info from the first set call? I'd just like to add a
> > > field called "numRows" that contains the int value of rows returned,
> > > into the gallery object.
>
> > > Thanks in advance!
>
> > > Regards
> > > DrLaban
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---