$obj
$obj : \Charcoal\Admin\Widget\FormGroup\ModelInterface|null
The form group's storage model.
Template Options Form Group
The form group widget displays a set of form controls based on properties assigned to a template controller's metadata.
This works best (minimal setup) if your model implements \Charcoal\App\Template\TemplateInterface.
Example #1 — Template options widget
{
"title": "Template Options",
"type": "charcoal/admin/widget/form-group/template-options",
"template": "charcoal/admin/widget/form-group/structure"
}
Example #2 — With custom template controller
{
"title": "Template Options",
"type": "charcoal/admin/widget/form-group/template-options",
"template": "charcoal/admin/widget/form-group/structure",
"controller_ident": "foobar/template/front-page"
}
Example #3 — With property for selecting a template controller
When changing the object's active template, the form must be saved and reloaded to display the new template options. {@todo Eventually, the form will automatically reload the template options widget when changing templates}.
{
"title": "Template Options",
"type": "charcoal/admin/widget/form-group/template-options",
"template": "charcoal/admin/widget/form-group/structure",
"template_property": "template_ident"
}
setData(array $data) : \Charcoal\Admin\Widget\FormGroupWidget
array | $data | Widget data. |
Chainable
setFormGroup(\Charcoal\Ui\FormGroup\FormGroupInterface $formGroup) : \Charcoal\Admin\Widget\FormGroup\StructureFormGroup
Set the form input's parent group.
\Charcoal\Ui\FormGroup\FormGroupInterface | $formGroup | The parent form group object. |
clearFormGroup() : \Charcoal\Admin\Widget\FormGroup\StructureFormGroup
Clear the group's parent group.
setStorageProperty(string|\Charcoal\Property\PropertyInterface $propertyIdent) : \Charcoal\Admin\Widget\FormGroup\StructureFormGroup
Set the form group's storage target.
Must be a property of the form's object model that will receive an associative array of the form group's data.
string|\Charcoal\Property\PropertyInterface | $propertyIdent | The property identifier—or instance—of a storage property. |
If the property identifier is not a string.
If a property data is invalid.
setGroupProperties(array $properties) : \Charcoal\Admin\Widget\FormGroupWidget
array | $properties | The group properties. |
Chainable
setPropertiesOptions(array $properties) : \Charcoal\Admin\Widget\FormGroupWidget
array | $properties | The options to customize the group properties. |
Chainable
setShowNotes(boolean|string $show) : \Charcoal\Admin\Widget\FormGroupWidget
Show/hide the widget's notes.
boolean|string | $show | Whether to show or hide notes. |
Chainable
setTemplateProperty(string|\Charcoal\Property\PropertyInterface $propertyIdent) : \Charcoal\Admin\Widget\FormGroup\StructureFormGroup
Set the form object's property for template controller choices.
Must be a property of the form's object model that will supply a list of properties.
string|\Charcoal\Property\PropertyInterface | $propertyIdent | The property identifier—or instance—of a storage property. |
If the property identifier is not a string.
If a property data is invalid.