You explanation is not so clear, but I think you mean that the
generateList returns only the id and not the 'Condition' field ? If
so, generateList is by default making the array of the fields named
'id' and 'name'.
As you might not have a 'name' field, you can set it into the model or
pass parameters to the generaList method such as :
generateList(null, null, '{n}.Condition.id',
'{n}.Condition.condition');
Hope this help and I am not misunderstanding the problem
On May 31, 12:10 pm, g5Maniac <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am tyring to generate a select list in an edit view - all very basic
> stuff. I am however getting the wierdes result to my query.
>
> diagnosis_controller
> (edit)
> $this->Diagnosis->id = $id;
> $this->data = $this->Diagnosis->read();
> $this->set('conds',$this->Diagnosis->Condition->generateList());
>
> edit view
> <p><select>
> <?php foreach($conds as $cond): ?>
> <option value="<?php echo $cond['id'] ?>"><?php echo
> $cond['Condition'] ?></option>
> <?php endforeach; ?>
> </select></p>
>
> This returns the id for each condition, but only 1 character of it!. I
> turned debug on and in the SQL I can see
> SELECT 'Condition'.'id' FROM 'conditions' as 'Condition' WHERE 1=1
>
> Now thats some bizzare SQL!
>
> Any Ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---