joshkosmala / silverstripe-hierarchicalcheckboxsetfield
A SilverStripe form field for adding nested checkboxes using parent and child dataobjects
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 3
Open Issues: 5
Type:silverstripe-module
Requires
- silverstripe/cms: ~3.1
- silverstripe/framework: ~3.1
This package is not auto-updated.
Last update: 2025-01-01 17:22:44 UTC
README
This field will produce a set of nested checkboxes.
The source can be a Hierarchy
of dataobjects, or a multi dimensional array.
The values can be a be an array or a string.
Usage
$field = HierarchicalCheckboxSetField::create("Pages", "Pages", Page::get() ->filter("ParentID", 0), "Children", Page::get() ->filter("ParentID", 0) ->filter("ShowInMenus", true) ->map('ID','ID') ->toArray() ); $field->setChildSort("Title DESC"); $field->setChildFilter("ShowInSearch = 1");