# app/config.yml
apy_js_form_validation:
enabled: true
yui_js: false
check_modes: [submit, blur]
javascript_framework: jquery
validation_bundle: APYJsFormValidationBundle
script_directory: bundles/jsformvalidation/js/
warmer_routes: [route1,route2]
identifier_field: jsfv_identifier
translation_group: validators
-
enabled
is optional (Default:true
). Set tofalse
disable all javascript form validations if you use the Twig function. -
yui_js
is optional (Default:false
). Set totrue
enable yui compressor.yui_js
assetic filter have to be defined. -
check_mode
DEPRECATED usecheck_modes
instead. -
check_modes
is optional (Default: ["submit", "blur"]). Modes of the validation. Addsubmit
to enable a validation of a form on the submit action. Addblur
to enable a validation of a field of a form when the field lost the focus. Addchange
to enable a validation of a field of a form when the field is changed. This will behave mostly the same asblur
, but will avoid race condition and false validation errors to appear with widgets like jQueryUI datepicker. -
javascript_framework
is recommended (Default:jquery
). Javascript framework used by the validation script. Choices:jquery
,mootools
,prototype
,yui3
,dojo
,zepto
orextjs
-
validation_bundle
is optional (Default:APYJsFormValidationBundle
). You can override the default implementation of the validation script and its framework variants in your bundle.
Here is the template of the common script for validation.
APYJsFormValidationBundle::JsFormValidation.js.twig
Here is a framework template of a the common script for validation.
APYJsFormValidationBundle:Frameworks:JsFormValidation.your_framework.js.twig
-
script_directory
is optional (Default:bundles/jsformvalidation/js/
). Define where scripts will be generated. -
warmer_routes
is optional (Default:~
). See Assets warmer -
identifier_field
is optional (Default:jsfv_identifier
). Defines the name of the hidden field which serves to convey the primary identifier value for UniqueEntity constraint request. This value will be ignored when entity is updated. -
translation_group
is optional (Default:validators
) This option determines which validation group will be used by the translator: Translator.get('{{ 'translation_group' }}':'+key, placeholders, number); For more information look at Validation Groups of Symfony user's manual.