How to print the all "select" Attribute options?

Permalink
I want to create this style of feature (gallery with filter and sort)
http://codepen.io/deuns/pen/fgwma...

I create new file select attribute (handle name "subject")
With options:
option1
option2
option3


Now I need somehow to loop and echo all select option (for the control menu)
button  data-filter=option-1
button  data-filter=option-2
button  data-filter=option-3


I remember i saw official tut about this, but i dont find him

siton
 
hutman replied on at Permalink Best Answer Reply
hutman
I think you should be able to do something like this

$attrKey = FileAttributeKey::getByHandle('subject');
$cont = $attrKey->getController();
$attrOptions = $cont->getOptions();
foreach($attrOptions as $option){
   // do whatever you want with the attribute option
}
siton replied on at Permalink Reply
siton
Thanks :) its work great.