> ---------------------------------------------------------------------------------------------
> [textfield: companyname]
> [textfield: membername_1] [textfield: joined_at] [textfield: left_at]
> [textfield: membername_2] [textfield: joined_at] [textfield: left_at]
> [textfield: membername_3] [textfield: joined_at] [textfield: left_at]
> ...
> [button:save]
> ---------------------------------------------------------------------------------------------

If your controller does a recursive find() or findAll(), like this:


function view($id=null)
{
  $myModel = $this->myModel();
  $this->myModel->id = $id;
   // read() will not do: no recursion, but...
   // remember to pass query conditions as the first arg to find()
   // null will put "WHERE 1 = 1" in the query
  $r = $this->$iam->find('"Company"."id" = '.$id, NULL, NULL, 2); // one could 
put this into the model as well
  $this->set('company', $r);
}


Do a pr($company) in your view to see what shows up.

Your edit() action needs a bit more work, but I hope you get the drift.

=======

PS:
until I find a better way (component or such) i've put these in my controllers:
(thats not really DRY, but working on it :)


private function meis()
{
  return $this->modelClass;
}


private function &myData()
{
  return $this->data[$this->meis()];
}


private function &myModel()
{
  $modelName = $this->meis();
  return $this->$modelName;
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to