Having trouble getting all of my tables info in my view.

I am trying to get both portfoios and powerdbies table info in there.

Right now I can sucessfully get my portfolio info in there like this:

portfolios_controller:

function currentprojects() {
$Portfolio = $this->paginate('Portfolio', array('Portfolio.status' =>
'current'), array('contain' => 'User'));
$this->set('Portfolio', $Portfolio);
}

currentprojects.ctp:

<?php foreach($Portfolio as $Portfolio): ?>
<div class="boxgrid captionfull">
<img src="../img/<?php echo $Portfolio['Portfolio']['img']; ?>"
width="190" height="152" />
<div class="cover boxcaption">
<h2><a href="http://www.<?php echo $Portfolio['Portfolio']['url']; ?>"
target="_blank"><?php echo $Portfolio['Portfolio']['url']; ?></a></h2>
<div class="portfolioicon">
WANT TO INSERT THE LOOP TO GET ALL OF MY IMG FROM MY POWEREDBIES TABLE
HERE.  NOTHING WORKS - NOT SURE WHAT VARIABLE TO USE??
</div>
</div>
</div>
<?php endforeach; ?>

Here I have the foreach statement for the portfolios info but can't
figure out what to do to try and get the HABTM info of poweredbies.  I
want to have a foreach loop for the related entries.

Here is my dump (which seems to be getting the poweredbies info):

Array
(
    [0] => Array
        (
            [Portfolio] => Array
                (
                    [id] => 1
                    [user_id] => 0
                    [url] => 29thstreetrep.com
                    [description] => Off-Broadway New York City
theater company known for its brutal play selections.
                    [domain_start] => 1999-08-02
                    [domain_expire] => 2011-08-02
                    [domain_owner] => David Mogentale
                    [host] => BMCO
                    [category] => theatre
                    [status] => current
                    [img] => portfolio_29thstreetrep.gif
                    [created] =>
                    [modified] =>
                )

            [User] => Array
                (
                    [id] =>
                    [username] =>
                    [password] =>
                    [first_name] =>
                    [last_name] =>
                    [address_1] =>
                    [address_2] =>
                    [city] =>
                    [state] =>
                    [zip] =>
                    [telephone] =>
                    [cellphone] =>
                    [email] =>
                    [created] =>
                    [modified] =>
                )

            [Poweredby] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [img] => portfolioicon_xhtml.gif
                            [PortfoliosPoweredby] => Array
                                (
                                    [id] => 1
                                    [portfolio_id] => 1
                                    [poweredby_id] => 1
                                )

                        )

                    [1] => Array
                        (
                            [id] => 2
                            [img] => portfolioicon_css.gif
                            [PortfoliosPoweredby] => Array
                                (
                                    [id] => 2
                                    [portfolio_id] => 1
                                    [poweredby_id] => 2
                                )

                        )

                    [2] => Array
                        (
                            [id] => 3
                            [img] => portfolioicon_flash.gif
                            [PortfoliosPoweredby] => Array
                                (
                                    [id] => 3
                                    [portfolio_id] => 1
                                    [poweredby_id] => 3
                                )

                        )

                    [3] => Array
                        (
                            [id] => 4
                            [img] => portfolioicon_php.gif
                            [PortfoliosPoweredby] => Array
                                (
                                    [id] => 4
                                    [portfolio_id] => 1
                                    [poweredby_id] => 4
                                )

                        )

                    [4] => Array
                        (
                            [id] => 5
                            [img] => portfolioicon_mysql.gif
                            [PortfoliosPoweredby] => Array
                                (
                                    [id] => 5
                                    [portfolio_id] => 1
                                    [poweredby_id] => 5
                                )

                        )

                )

        )

Also - I am using "var $actsAs = array('Containable');" in my models
and it is still outputting the user data.

Any help would be greatly appreciated.

Thank you!!

Brad

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to