title: SilverStripe enum values to menu
body: <p>I'm trying to pull out enum values from a dataobject to act as a menu/filter. I have not been able to find any documentation on how to do this and my attempts have all failed.</p>
  
  <p>For example I have:</p>
  
  <pre><code>class Specification extends DataObject {
      private static $db = array (
          'Standard' =&gt; 'Enum("BS 1400,AS 1565")'
      );
  }
  </code></pre>
  
  <p>I'm trying to do something like: </p>
  
  <pre><code>public function Standards() {
      $stnds = Specification::get()-&gt;dbObject('Standard')-&gt;enumValues();
      $list = ArrayList::create();
  
      foreach ($stnds as $stnd) {
          $list-&gt;push($stnd);
      }
      return $list;
  }
  </code></pre>
  
  <p>I want to be able to loop the resulting values in the template, but can't access the labels - if I do:</p>
  
  <pre><code>&lt;% loop Standards %&gt;
      $Pos
  &lt;% end_loop %&gt;
  </code></pre>
  
  <p>This gives me <code>1 2</code>, which suggests it is working, but cannot access the enum value labels in the template. </p>
  
  <p>How do I correctly return these values so they can be looped through in the template?</p>