Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » MultiValueField in silverstripe template

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 403 Views
  • fiord
    Community Member
    79 Posts

    MultiValueField in silverstripe template Link to this post

    I use https://github.com/nyeholt/silverstripe-multivaluefield for my product $size values.
    How to display these values ​​in a template?

    public static $db = array(
          'Size' => 'MultiValueField'
    $sourceSize = array(
                         "12м." => "12м. (74-80см)",
                         "18м." => "18м. (80-86см)",
                         "2г." => "2 (86-98см)"
          $fields->addFieldToTab('Root.Main', new MultiValueCheckboxField('Size', 'Размер',$source = $sourceSize));

    $SizeValue show to me a:4:{s:5:"12м.";s:5:"12м.";s:5:"18м.";s:5:"18м.";s:4:"2г.";s:4:"2г.";s:4:"4г.";s:4:"4г.";}
    how to navigate through an array $Size?

    <% loop Size %>$Value
    <% end_loop %>

    - does not show the values of ​​array

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.