Source of file UserFormsOptionSetField.php
Size: 1,008 Bytes - Last Modified: 2021-12-23T10:35:40+00:00
/var/www/docs.ssmods.com/process/src/code/FormField/UserFormsOptionSetField.php
123456789101112131415161718192021222324252627282930313233 | <?php namespace SilverStripe\UserForms\FormField; use SilverStripe\Forms\OptionsetField; use SilverStripe\UserForms\Model\EditableFormField; /** * @package userforms */ class UserFormsOptionSetField extends OptionsetField { /** * If your project uses a custom UserFormsCheckboxSetField.ss, ensure that it includes * `$Top.getValidationAttributesHTML().RAW` so that custom validation messages work * For further details see * templates/SilverStripe/UserForms/FormField/UserFormsCheckboxSetField.ss * * Use on a template with .RAW - single and double quoted strings will be safely escaped * * @return string * @see EditableFormField::updateFormField() */ public function getValidationAttributesHTML() { $attrs = array_filter(array_keys($this->getAttributes()), function ($attr) { return !in_array($attr, ['data-rule-required', 'data-msg-required']); }); return $this->getAttributesHTML(...$attrs); } } |