7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » How i call from the classID, $variablename?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 310 Views |
-
How i call from the classID, $variablename?

26 January 2011 at 6:07am
$f ->addFieldToTab(
'Root.Main',
new DropdownField(
'MarcaID',
'Marca',
DataObject::get('Marca')->toDropDownMap()
)
);Sample i want show the variable $Nomecat this class Marca
-
Re: How i call from the classID, $variablename?

26 January 2011 at 6:51am
I'm having a hard time understanding what you want, but it might help you to know that toDropdownMap() takes two arguments.
->toDropdownMap($value, $text);
they default to "ID" and "Title".
Maybe you want ->toDropdownMap('ID','Nomecat') ??
Just guessing.
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
| 310 Views | ||
|
Page:
1
|
Go to Top |

