X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FCGI%2FEx%2FApp.pod;h=2967cbe3972d4bdf5caa4aff09db3c0c9978b5e3;hb=refs%2Ftags%2Fv2.24;hp=b231a0b98bd3bc74db55287167bb62402e706b14;hpb=18123183bfb2737ea337306c9d705fca5b5e50d6;p=chaz%2Fp5-CGI-Ex diff --git a/lib/CGI/Ex/App.pod b/lib/CGI/Ex/App.pod index b231a0b..2967cbe 100644 --- a/lib/CGI/Ex/App.pod +++ b/lib/CGI/Ex/App.pod @@ -256,6 +256,7 @@ during the run_step hook. ->info_complete (hook - ran if prepare was true) ->ready_validate (hook) + ->validate_when_data (hook) # returns false from info_complete if ! ready_validate ->validate (hook - uses CGI::Ex::Validate to validate form info) ->hash_validation (hook) @@ -1028,7 +1029,8 @@ steps to the end of the current path. =item auth_args (method) -Should return a hashref that will be passed to the new method of CGI::Ex::Auth. +Should return a hashref that will be passed to the auth_obj method +which should return a CGI::Ex::Auth compatible object. It is augmented with arguments that integrate it into CGI::Ex::App. See the get_valid_auth method and the CGI::Ex::Auth documentation. @@ -1051,6 +1053,11 @@ was successful - so this data can be defined but false. See the get_valid_auth method. +=item auth_obj (method) + +Passed auth_args. Should return a CGI::Ex::Auth compatible object. Default +is to call CGI::Ex::Auth->new with the passed args. + =item base_dir_abs (method) Used as the absolute base directory to find template, validation and conf files. @@ -2096,6 +2103,13 @@ and check for its presence - such as the following: Changing the behavior of ready_validate can help in making wizard type applications. +You can also use the validate_when_data hook to change the behavior of +ready_validate. If valiate_when_data returns true, then +ready_validate will look for keys in the form matching keys that are +in hash_validation - if they exist ready_validate will be true. If +there are no hash_validation keys, ready_validate uses its default +behavior. + =item refine_path (hook) Called at the end of nav_loop. Passed a single value indicating @@ -2272,8 +2286,11 @@ This method is not normally used. =item set_ready_validate (hook and method) Sets that the validation is ready (or not) to validate. Should set the value -checked by the hook ready_validate. The following would complement the -processing flag above: +checked by the hook ready_validate. Has no affect if validate_when_data +flag is set. + +The following would complement the "processing" flag example given in +ready_validate description: sub set_ready_validate { my $self = shift; @@ -2460,6 +2477,14 @@ path. A validation item of: would append 'bar' and 'baz' to the path should all validation succeed. +=item validate_when_data (hook) + +Defaults to "validate_when_data" property which defaults to false. Called +during the ready_validate hook. If returns true, ready_validate will look +for keys in the form matching keys that are in hash_validation - if they exist +ready_validate will be true. If there are no hash_validation keys, ready_validate +uses its default behavior. + =item verify_user (method) Installed as a hook to CGI::Ex::App during get_valid_auth. Should return