joshkosmala / silverstripe-hierarchicalcheckboxsetfield
A SilverStripe form field for adding nested checkboxes using parent and child dataobjects
Package info
github.com/joshkosmala/silverstripe-hierarchicalcheckboxsetfield
Type:silverstripe-module
pkg:composer/joshkosmala/silverstripe-hierarchicalcheckboxsetfield
dev-master
2016-04-19 02:43 UTC
Requires
- silverstripe/cms: ~3.1
- silverstripe/framework: ~3.1
This package is not auto-updated.
Last update: 2026-02-25 22:47:33 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");