hof-behaviour-hooks
HOF Behaviour enabling lifecycle hooks for extending functionality in main form pipeline.
Usage
mixwith.js
Withconst mix = mix;const Hooks = ;const BaseController = ; BaseController ...
MyController
now extends hof-form-controller
and has hof-behaviour-hooks
functionality mixed in.
Functionality
The following hooks are currently supported, the methods are GET/POST pipeline methods from hof-form-controller
:
GET
_getErrors
-'pre-getErrors', 'post-getErrors'
_getValues
-'pre-getValues', 'post-getValues'
_locals
-'pre-locals', 'post-locals'
render
-'pre-render', 'post-render'
POST
_process
-'pre-process', 'post-process'
_validate
-'pre-validate', 'post-validate'
saveValues
-'pre-saveValues', 'post-saveValues'
successHandler
-'pre-successHandler', 'post-successHandler'
In field config
fields.js
moduleexports = 'field-1': hooks: { Object; ; } { reqbody'field-1' = reqbody'field-1'; ; }