> How would you get the enum values from the model or controller?

By far the easiest way is to go to 
http://cakeforge.org/snippet/detail.php?type=snippet&id=112
and copy and paste the code that's there into app_model.php, then you
can just use lines like the following in your code:

$types = $this->Album->getEnumValues('type');

In this example, 'type' is the name of the enum column, Album is the
model it's in, and 'types' is the variable that will automatically be
picked up by this line in the view (assuming you're using Cake 1.2
with its form helper):

echo $form->input('type');

This will give you a dropdown, just like the one you get for foreign
keys.

Hope that helps,
Zoe.
--~--~---------~--~----~------------~-------~--~----~
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