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.

Archive /

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

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

problem with select


Reply


3 Posts   862 Views

Avatar
ojalà

Community Member, 87 Posts

17 October 2008 at 2:35am

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?

Avatar
Liam

Community Member, 470 Posts

17 October 2008 at 3:16am

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.

Avatar
ojalà

Community Member, 87 Posts

17 October 2008 at 3:31am

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