Source of file UserFormsGroupField.php
Size: 0,892 Bytes - Last Modified: 2021-12-23T10:35:40+00:00
/var/www/docs.ssmods.com/process/src/code/FormField/UserFormsGroupField.php
123456789101112131415161718192021222324252627282930313233343536 | <?php namespace SilverStripe\UserForms\FormField; use SilverStripe\UserForms\Model\EditableFormField\EditableFieldGroupEnd; use SilverStripe\UserForms\Model\EditableFormField; /** * Front end composite field for userforms */ class UserFormsGroupField extends UserFormsCompositeField { public function __construct($children = null) { parent::__construct($children); $this->setTag('fieldset'); } public function getLegend() { // Legend defaults to title return parent::getLegend() ?: $this->Title(); } public function processNext(EditableFormField $field) { // When ending a group, jump up one level if ($field instanceof EditableFieldGroupEnd) { return $this->getParent(); } // Otherwise behave as per normal composite field return parent::processNext($field); } } |