Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Comma in Enum() value


Go to End


9 Posts   3865 Views

Avatar
Spambanjo

Community Member, 24 Posts

31 October 2014 at 4:13am

Sorry to revive an old thread, but I recently had this issue again, this time using Silverstripe 3. I actually stumbled over my own thread looking for the solution, which, as I am now more experienced with both PhP and Silverstripe, I was able to answer for myself.

Here's how to use commas in Enum values by passing in an array:

'Income' => "Enum(array('Under £20,000','£20,000-£29,999','£30,000-£39,999','$40,000 and over'))"

Go to Top