Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Creating a Dropdown or Radio without FK table 06 Jul 2016 06:59 #14154

Hi,
I would like to create a basic dropdown list - or radio button - with 3 items (Yes, No, Not Applicable) - without creating a table for it.

I have lots of these to do, and the values are all a little different. Creating tables for each one isn't really viable (too many).

I guess I can fork the code if I have too.

Is there a way with the Online Generator?

Grateful for any pointers...
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Creating a Dropdown or Radio without FK table 06 Jul 2016 07:23 #14156

I think I found my answer - is the Enumeration Field.

I wondered what that was for :)
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Creating a Dropdown or Radio without FK table 06 Jul 2016 09:36 #14158

Indeed :)

I personally try to use the enum only for thing that are highly unlikely to change, such as "gender"
When you use an enumeration, you loose flexibility.

Please Log in or Create an account to join the conversation.

Creating a Dropdown or Radio without FK table 06 Jul 2016 12:20 #14160

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I think @organicweb is correct. Enum is the best choice for that.
They are translatable strings, and you can edit them in the helper. I think it is flexible.

What I think it that they are not properly coded. I have to rewrite this part in future.
They WILL be located in
helpers/html/lists.php
And the call you not pass through the view file (too heavy). It will be a simple static call from the template.
For the moment, is is working anyways.

EDIT : And in the form, you can change the aspect (combo / radio / list)
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.061 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started