| [resolved] Gender dropdown with admingenerator [message #5175] |
Wed, 19 April 2006 15:32  |
fransica Messages: 16 Registered: April 2006 Location: Netherlands |
Junior Member |
|
|
Hello.
I want a dropdownmenu for my genderselection in the useradministration app. Gender is stored in an varchar(1). In the generated CRUD the gender input is a textfield. For easy usage this schould be a dropdown menu with the values M(ale) F(emale) and U(nkown).
Who can help me?
[Updated on: Thu, 20 April 2006 13:50] by Moderator
|
|
|
|
|
|
|
|
| Re: Gender dropdown with admingenerator [message #5237 is a reply to message #5175 ] |
Thu, 20 April 2006 13:22   |
fransica Messages: 16 Registered: April 2006 Location: Netherlands |
Junior Member |
|
|
It works! Thanks for the support!
My _gender_dropdown.php
<?php
echo select_tag('gender', options_for_select(Array('U' => 'Unknown', 'M' => 'Male', 'F' => 'Female'), $tblusers->getGender()))
?>
And the generator.yml
generator:
class: sfPropelAdminGenerator
param:
model_class: Tblusers
theme: default
fields:
gender_dropdown: { name: Gender }
edit:
display:
"General information": [surname, firstname, _gender_dropdown]
And I will regenerate my model using phpName.
[Updated on: Thu, 20 April 2006 13:22]
|
|
|
| Re: [resolved] Gender dropdown with admingenerator [message #5504 is a reply to message #5175 ] |
Wed, 26 April 2006 17:23   |
Seboss Messages: 20 Registered: April 2006 |
Junior Member |
|
|
My question is slightly off-topic but I think it fits in this thread.
I want to create product categories with different cultures. I store supported cultures in a culture table.
The create category form has a culture dropdown list populated from the culture table thanks to a _culture partial but it feels a bit clumsy.
Is there an easy way to generate a dropdown list with data from the culture table with generator.yml ?
[Updated on: Wed, 26 April 2006 17:23]
|
|
|
|