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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Field Types


Go to End


2 Posts   800 Views

Avatar
SilverstripeNewbie

Community Member, 14 Posts

21 September 2015 at 11:29pm

Lesson 6 has this code
$fields->addFieldToTab('Root.Main', DateField::create('Date','Date of article'));
$fields->addFieldToTab('Root.Main', TextareaField::create('Teaser'));
$fields->addFieldToTab('Root.Main', TextField::create('Author','Author of article'));

DateField, TextareaField, and TexField are for Date, Text, and varchar respectively.

But what are the equivalent for the the rest of the fields types to use woth the addFieldToTab method? So for Boolean CompositeDBField Currency Datetime Decimal Double Enum Float ForeignKey HTMLText HTMLVarchar Int Money MultiEnum Percentage PrimaryKey Text Time Year, what to use?