What exactly is the problem? If you know how to do that in the view,
then you can do the same thing in the controller. There's nothing
magical about passing find() results to the view using $this->set().
All it does is "set" the variables you specify in the view. If you
don't know the structure of $coupons, just use debug() to view it.

Also, technically those aren't objects, otherwise you'd access the
'title' property by $coupon->title; they're just associative arrays.

On May 26, 10:48 am, sherzo <[email protected]> wrote:
> Hi all
>
> I need to have something like the following code but in the controller not
> view.
> foreach ($coupons as $coupon)
>         $st = $coupon['Coupon']['title'];
> endforeach;
>
> and the $coupons is the result of a find() function.
>
> any idea?
>
> Thanks
> Sherrt
> --
> View this message in 
> context:http://old.nabble.com/array-of-objects-in-the-controller-tp28684091p2...
> Sent from the CakePHP mailing list archive at Nabble.com.

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

Reply via email to