【发布时间】:2020-03-11 13:28:39
【问题描述】:
根据 Octobercms documentation 我可以从模型类方法中获取选项。
但是当我尝试过滤列表时,我得到一个未定义的索引错误。
.../modules/backend/Widgets/Filter.php 第 417 行的“未定义索引:holiday_type”
我做错了什么?我想通过模型类从方法中获取选项
config_filter.yaml
# ===================================
# Filter Scope Definitions
# ===================================
scopes:
holiday_type:
label: Holiday Type
type: group
conditions: type in (:filtered)
options: getHolidayTypesAttribute
MyModel.php
public function getHolidayTypesAttribute(){
return [
1 => 'default',
2 => 'new'
];
}
【问题讨论】:
标签: backend octobercms octobercms-backend