NAME
Strehler::FormFu::Validator::CategoryUnique - FormFu Validator for Category form.
DESCRIPTION
A FormFu Validator to ensure that a user can't insert a category with the same name of a category already inserted. Parent value of the form must be checked because two category with the same name under different parents can exist.
This validator hasn't the standard HTML::FormFu validators namespace because it makes sense only in a Strehler system.
SYNOPSIS
In category form configuration:
- name: category
label: Category
constraints:
- type: Required
message:
'Category needed'
- type: Regex
regex:
'^[^\/]*$'
message:
'Invalid character'
validators:
- type:
'+Strehler::FormFu::Validator::CategoryUnique'
message:
'Category already exists'