add 'Length' constraint in forms
This commit is contained in:
parent
d3f27d97ad
commit
c1eb277a6a
|
@ -3,6 +3,7 @@
|
||||||
### Added
|
### Added
|
||||||
* allow to define templates show before and after a murph collection item
|
* allow to define templates show before and after a murph collection item
|
||||||
* add global batch actions
|
* add global batch actions
|
||||||
|
* add constraint `Length` in forms
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* fix regression on crud sorting
|
* fix regression on crud sorting
|
||||||
|
|
|
@ -138,7 +138,8 @@ class Configuration implements ConfigurationInterface
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end();
|
->end()
|
||||||
|
;
|
||||||
|
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
|
||||||
class MenuType extends AbstractType
|
class MenuType extends AbstractType
|
||||||
|
@ -23,6 +24,7 @@ class MenuType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -37,6 +39,7 @@ class MenuType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
|
||||||
class NavigationAdditionalDomainType extends AbstractType
|
class NavigationAdditionalDomainType extends AbstractType
|
||||||
|
@ -24,6 +25,7 @@ class NavigationAdditionalDomainType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -27,6 +27,7 @@ class NavigationType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -41,6 +42,7 @@ class NavigationType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -69,6 +71,7 @@ class NavigationType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -109,7 +112,7 @@ class NavigationType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
new Length(['min' => 2, 'max' => 10]),
|
new Length(min: 2, max: 10),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -13,6 +13,7 @@ use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
|
||||||
class NodeType extends AbstractType
|
class NodeType extends AbstractType
|
||||||
|
@ -29,6 +30,7 @@ class NodeType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -43,6 +45,7 @@ class NodeType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -82,6 +85,7 @@ class NodeType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -116,6 +120,9 @@ class NodeType extends AbstractType
|
||||||
|
|
||||||
return $choices;
|
return $choices;
|
||||||
}),
|
}),
|
||||||
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\Image;
|
use Symfony\Component\Validator\Constraints\Image;
|
||||||
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
|
||||||
class PageType extends AbstractType
|
class PageType extends AbstractType
|
||||||
|
@ -26,6 +27,7 @@ class PageType extends AbstractType
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -39,6 +41,7 @@ class PageType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -52,6 +55,7 @@ class PageType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -65,6 +69,7 @@ class PageType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -78,6 +83,7 @@ class PageType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
],
|
],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
|
new Length(max: 255),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue