Jump to:

7935 Posts in 1536 Topics by 943 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, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 413 Views
  • Dr0gaz
    Avatar
    Community Member
    37 Posts

    How i call from the classID, $variablename? Link to this post

    $f ->addFieldToTab(
       'Root.Main',
       new DropdownField(
    'MarcaID',
    'Marca',
    DataObject::get('Marca')->toDropDownMap()
          )
           );

    Sample i want show the variable $Nomecat this class Marca

  • UncleCheese
    Avatar
    4085 Posts

    Re: How i call from the classID, $variablename? Link to this post

    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

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