@sam
thanks this seems to be working
I did my everyday mistake as so often in the past
just never know where to place wich part of my code :/
I added the find to the controller
and pass the data I got to the view and use and display it there
controller:
$this->set('meals', ($this->Customer->Request->Meal0->find('list')));
view:
$debug($meals);
solved :)
On 14 Jun., 21:49, Sam Sherlock <[email protected]> wrote:
> you can select which fields of a table you wish to retrive.
> if my model is Article then:
> $this->Article->find('all', array(
> ...
> 'fields' => array('Article.field1', 'DISTINCT Article.field2')
> ...
> ));
>
> seehttp://book.cakephp.org/view/1017/Retrieving-Your-Data
>
> you can use the containable behaviour to control the related models which
> find returns
> <http://book.cakephp.org/view/1017/Retrieving-Your-Data>http://book.cakephp.org/view/1323/Containable
>
> <http://book.cakephp.org/view/1323/Containable>does that help?
>
> - S
>
> On 14 June 2010 19:26, mivogt-LU <[email protected]> wrote:
>
> > HI there,
>
> > if I choos in the index view the view button I get all my models data
> > and also the related models are shown somehow.
>
> > i.e. if I choos from customer-index: view I get the customer details.
> > I also get the orders he placed in some manner.
> > Sadly instead of an item name I am only shown the indexnumbers.
>
> > i.e.:
>
> > Related Bookings
> > Id Name Customer Id Mealclass Id Request Id
>
> > I would like to show up other fields instead of the id.
> > instead of requestID I prefer showing requestName
> > instead of mealclassID I prefer showing mealclassKennung
>
> > Might you please tell me how to change my code from
> > <td><?php echo $booking['id'];?></td>
> > <td><?php echo $booking['name'];?></td>
> > <td><?php echo $booking['customer_id'];?></td>
> > <td><?php echo $booking['mealclass_id']; ?></td>
> > <td><?php echo $booking['request_id'];?></td>
>
> > to something doing as I want?
> > I know I ll need to use the indexes to show up the fitting item out of
> > the database.
> > But still not that fit in cake to get the solution on my own.
>
> > Thanks in advance..
>
> > Michael
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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]<cake-php%[email protected]>For
> > more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
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