Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » problem with select

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 819 Views
  • ojalà
    Avatar
    Community Member
    87 Posts

    problem with select Link to this post

    HI!
    I have a problem in creation of select. I follow documentation http://doc.silverstripe.com/doku.php?id=dropdownfield.

    I put in Page.php

    class MyObject extends DataObject {
    static $db = array(
    'Country' => "Enum('New Zealand,United States,Germany','New Zealand')"
    );
    }

    under

    class Page extend SiteTree{ ..... }

    and in the controller of my page

    class Page_Controller extend ContentController{

    $field = new DropdownField(
    'Country',
    'Country',
    singleton('MyObject')->dbObject('Country')->enumValues()
    );
    }

    but something is wrong, can you help me?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: problem with select Link to this post

    Are you trying to use this in the CMS area or on the front end of the site?

    You'll just have to adjust where you're putting the actual info.

  • ojalà
    Avatar
    Community Member
    87 Posts

    Re: problem with select Link to this post

    I want use select from front end of my site,not from CMS..

    819 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.