On May 23, 2007, at 4:21 PM, pete wrote:

>
> hm..
> i want to print out all projects and instead of the project.status_id,
> i want to show the status.title
>
> how could i do that?

If Project belongsTo Status:

$projects = $this->Project->findAll();

foreach($projects as $project)
{
        echo $project['Status']['title'];
}

(completely off the cuff, test it and play with it to get it to work)

-- John

>
> thanks
>
> pete
>
> On May 23, 5:29 pm, "John David Anderson (_psychic_)"
> <[EMAIL PROTECTED]> wrote:
>> On May 23, 2007, at 3:21 PM, pete wrote:
>>
>>
>>
>>> hi,
>>> i have problems using hasOne
>>> basically i want to achieve: a project hasOne status
>>
>>> TABLES
>>> projects
>>>   id
>>>   title
>>>   status_id
>>
>>> statuses
>>>   id
>>>   title
>>
>> The way you have things keyed here, its actually
>>
>> Status hasOne Project (and Project belongsTo Status).
>>
>> -- John
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to