From 287c70c6f3013ee8bf03bd4551a07bbc2f40affb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 28 Dec 2015 21:13:05 +0100 Subject: [PATCH] add validation rule on slug for custom fields --- Resources/config/validation.yml | 7 +++++++ Resources/translations/validators.fr.yml | 1 + 2 files changed, 8 insertions(+) create mode 100644 Resources/config/validation.yml create mode 100644 Resources/translations/validators.fr.yml diff --git a/Resources/config/validation.yml b/Resources/config/validation.yml new file mode 100644 index 000000000..419f35a68 --- /dev/null +++ b/Resources/config/validation.yml @@ -0,0 +1,7 @@ +Chill\CustomFieldsBundle\Entity\CustomField: + properties: + slug: + - Regex: + pattern: '/^[0-9a-z\-]{1,}$/' + message: Characters not allowed. Only lowercase letters, numbers and "-" are allowed. + \ No newline at end of file diff --git a/Resources/translations/validators.fr.yml b/Resources/translations/validators.fr.yml new file mode 100644 index 000000000..afb6575ba --- /dev/null +++ b/Resources/translations/validators.fr.yml @@ -0,0 +1 @@ +Characters not allowed. Only lowercase letters, numbers and "-" are allowed.: Caractères non autorisés. Seules les lettres minuscules, les nombres et le tiret ("-") sont autorisés. \ No newline at end of file