public static function RenameAdminPathsValidator::isValidPath in Rename Admin Paths 8.2
Force path replacement values to contain only lowercase letters, numbers, and underscores.
Parameters
string $value:
Return value
boolean
3 calls to RenameAdminPathsValidator::isValidPath()
- RenameAdminPathsSettingsForm::validate in src/
Form/ RenameAdminPathsSettingsForm.php - Form element validation handler.
- RenameAdminPathsValidatorTest::testInvalidPath in tests/
src/ Unit/ Form/ RenameAdminPathsValidatorTest.php - @dataProvider invalidPaths
- RenameAdminPathsValidatorTest::testValidPath in tests/
src/ Unit/ Form/ RenameAdminPathsValidatorTest.php - @dataProvider validPaths
File
- src/
Form/ RenameAdminPathsValidator.php, line 17
Class
Namespace
Drupal\rename_admin_paths\FormCode
public static function isValidPath(string $value) : bool {
return (bool) preg_match('~^[a-zA-Z0-9_-]+$~', $value);
}