Untitled
unknown
php
2 years ago
436 B
8
Indexable
if ('x_bm_categories' == $field_name) {
$categories = Shop_Category::create()->find_all();
//print_r(count($categories));
$options = [
'' => '',
];
foreach($categories as $category) {
$options = [
$category->id => $category->name,
];
}
if (-1 == $current_value) {
return $options;
}
if (array_key_exists($current_value, $options)) {
return $options[$current_value];
}
}Editor is loading...