Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » how to connect two values from $fields in CMS to one value ?

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

Page: 1
Go to End
Author Topic: 945 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    how to connect two values from $fields in CMS to one value ? Link to this post

    hi

    i have two dropdownfields

    static $db = array(
    'calendar_month' => "Enum('01,02,03,04,05,06,07,08,09,10,11,12','01')",
    'calendar_year => "Enum('2009,2010,2011','2009')"
    'calendar' => 'text'
    );

    static $has_one = array(
    );

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab("Root.Content.Main", new DropdownField('calendar_month','Select month',singleton('PlOpiniePage')->dbObject('calendar_month')->enumValues()),Content);
    $fields->addFieldToTab("Root.Content.Main", new DropdownField('calendar_year','Select year',singleton('PlOpiniePage')->dbObject('calendar_year')->enumValues()),Content);
    return $fields;
    }

    how to connect these two values to one and put it into 'calendar' field ?

    01 + 2009 = 012009

    945 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.