Skip to content

Instantly share code, notes, and snippets.

@YuzuruSano
Last active October 30, 2015 14:09
Show Gist options
  • Save YuzuruSano/23eac42d430e516f963a to your computer and use it in GitHub Desktop.
Save YuzuruSano/23eac42d430e516f963a to your computer and use it in GitHub Desktop.
設定したページ属性「選択」のデータをバラで取得する
<?php
$ak = CollectionAttributeKey::getByHandle('attribute_handle');
$atc = $ak->getController();
if ($atc->attributeType->atHandle == 'select') {
$optionList = $atc->getOptions();
if ($optionList->count() > 0) {
$options = $optionList->getOptions();
var_dump($options);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment