protected function CvValidatorBase::getElementTitle in Clientside Validation 2.0.x
Same name and namespace in other branches
- 8.2 src/CvValidatorBase.php \Drupal\clientside_validation\CvValidatorBase::getElementTitle()
- 8 src/CvValidatorBase.php \Drupal\clientside_validation\CvValidatorBase::getElementTitle()
- 3.0.x src/CvValidatorBase.php \Drupal\clientside_validation\CvValidatorBase::getElementTitle()
Get title for form element.
Parameters
array $element: Element.
string $default: Default value for the title.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup|mixed Title value.
10 calls to CvValidatorBase::getElementTitle()
- Email::getRules in src/
Plugin/ CvValidator/ Email.php - Get the validation rules for this form element.
- EqualTo::getRules in clientside_validation_jquery/
src/ Plugin/ CvValidator/ EqualTo.php - Get the validation rules for this form element.
- Max::getRules in src/
Plugin/ CvValidator/ Max.php - Get the validation rules for this form element.
- MaxLength::getRules in src/
Plugin/ CvValidator/ MaxLength.php - Get the validation rules for this form element.
- Min::getRules in src/
Plugin/ CvValidator/ Min.php - Get the validation rules for this form element.
File
- src/
CvValidatorBase.php, line 89
Class
- CvValidatorBase
- Class CvValidatorBase.
Namespace
Drupal\clientside_validationCode
protected function getElementTitle(array $element, $default = '') {
$title = $this
->getAttributeValue($element, 'title');
if (empty($title) && empty($default)) {
return t('This field');
}
return $title ? $title : $default;
}