When I try this:
$entry = Set::extract('Showcase.{n}.Entry.{n}.image', $portfolio);
debug($entry);
I get:
Array
(
[0] => Array
(
[0] => 262c13a743e.jpg
[1] => 2b9fd9e1264.jpg
[2] => 7bc121658d5.jpg
[3] => cf633a6da88.jpg
[4] => db775cd8456.jpg
)
[1] => Array
(
)
[2] => Array
(
)
[3] => Array
(
)
[4] => Array
(
)
)
I just need help with the view so Showcase shows up and the Entry images
show up with that Showcase.
Foreach ['Showcase]'.{n}.['Entry'].{n}.['image'] <= I just don’t know how to
use the numbers from the array where {n} is
<?php
foreach ($portfolio['Showcase]'.{n}.['Entry'].{n}.['image'] as $entry):
?>
<?php echo $entry['image'];?>
<?php endforeach; ?>
-----Original Message-----
From: Dave Maharaj :: WidePixels.com [mailto:[email protected]]
Sent: July-22-09 2:20 PM
To: [email protected]
Subject: RE: Array Help
SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; Returns nothing
because that Showcase has no Entries
SELECT * FROM entries WHERE showcase_id = '5edd082b249'; Returns the 5 test
entries I have added for that Showcase
The correct data is being pulled I just cant get the ['Entry']['image'] for
each of the ['Showcases'] to the view.
Dave
-----Original Message-----
From: brian [mailto:[email protected]]
Sent: July-22-09 2:07 PM
To: [email protected]
Subject: Re: Array Help
Run this query on the DB:
SELECT * FROM entries WHERE showcase_id = '6bd19a7775f';
See anything?
On Wed, Jul 22, 2009 at 12:22 PM, Dave Maharaj ::
WidePixels.com<[email protected]> wrote:
>
> I have this array and trying to do a for each Showcase Entry to show
> up with the Showcase.
>
> I just cant seem to get the Entry array for each Showcase to appear.
>
> Each Showcase apers but no Entry associated with it.
>
> [Showcase] => Array
> (
> [0] => Array
> (
> [id] => 5edd082b249
> [created] => 2009-07-15 21:40:11
> [modified] => 2009-07-15 21:40:11
> [Entry] => Array
> (
> [0] => Array
> (
> [id] => 262c13a743e
> [showcase_id] => 5edd082b249
> [order] => 0
> [image] => 262c13a743e.jpg
> )
>
> [1] => Array
> (
> [id] => 2b9fd9e1264
> [showcase_id] => 5edd082b249
> [order] => 0
> [image] => 2b9fd9e1264.jpg
> )
>
> [2] => Array
> (
> [id] => 7bc121658d5
> [showcase_id] => 5edd082b249
> [order] => 0
> [image] => 7bc121658d5.jpg
> )
>
> [3] => Array
> (
> [id] => cf633a6da88
> [showcase_id] => 5edd082b249
> [order] => 0
> [image] => cf633a6da88.jpg
> )
>
> [4] => Array
> (
> [id] => db775cd8456
> [showcase_id] => 5edd082b249
> [order] => 0
> [image] =>
> petemaharaj_db775cd8456.jpg
> )
>
> )
>
> )
>
> [1] => Array
> (
> [id] => 6bd19a7775f
> [created] => 2009-07-15 21:39:16
> [modified] => 2009-07-15 21:39:16
> [Entry] => Array
> (
> )
>
> )
>
>
> Dave
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---