Hi all,
I have a page that displays a list of projects, projects can habtm
teams and vice versa, when the page first loads the $projects array is
populated via:
$this->set('projects', $this->Project->findAll());
Which returns ALL projects. Now on the page there is a select box that
posts back to the controller an id of a team in order to show projects
JUST for that team. This time the projects array is filled via:
$this->set('projects', $this->Project->Team->find(array('Team.id' =>
$_POST['team_id'])));
My problem is that these two requests return different array
structures, so my index.thtml is fine for the initial view all, but
falls over for the other request.
I have currently got around the problem by creating a second view file
and call 'render('secondview')' which is altered to accept the
different array (ie the looping etc)
What I want to know is if this is the correct way of doing this or
have I missed something fundamental?
TIA,
toby.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---