Renamed 'callbacks' chapter in User manual to 'Script execution'.

pull/7/head
Ferry Boender 10 years ago
parent 9f7b7ddc16
commit 1a3d10cdee
  1. 29
      doc/MANUAL.md

@ -24,9 +24,10 @@ This is the manual for version %%VERSION%%.
1. [Output](#output) 1. [Output](#output)
- [Output types](#output_types) - [Output types](#output_types)
- [Exit codes](#output_exitcodes) - [Exit codes](#output_exitcodes)
1. [Callbacks](#callbacks) - [Serving static files](#output_static_files)
- [Validation](#callbacks_validation) 1. [Script execution](#script_execution)
- [Field Values](#callbacks_fieldvalues) - [Validation](#script_validation)
- [Field Values](#script_fieldvalues)
1. [Users](#users) 1. [Users](#users)
- [Passwords](#users_passwords) - [Passwords](#users_passwords)
- [Form limiting](#users_formlimit) - [Form limiting](#users_formlimit)
@ -369,24 +370,30 @@ and shown to the user in the browser.
If a script's exit code is not 0, it is assumed an error occured. Scriptform If a script's exit code is not 0, it is assumed an error occured. Scriptform
will show the script's stderr output (in red) to the user instead of stdin. will show the script's stderr output (in red) to the user instead of stdin.
## <a name="script_executing">Script execution</a>
## <a name="callbacks">Callbacks</a> When the user submits the form, scriptform will validate the provided values.
If they check out, the specified script for the form will be executed.
Callbacks are called after the form has been submitted and its values have been A script can be any kind of executable, written in any kind of language,
validated. They are the actual implementations of the form's action. including scripting languages. As long as it is executable, can read the
environment and output things to stdout it is usable. Scippts written in
scripting languages should include the shebang line that indicates which
interpreter it should use:
A script callback can be any kind of executable, written in any kind of #!/usr/bin/php
language. As long as it is executable, can read the environment and output <?php
things to stdout, it can be used as a callback. echo("Hello!");
?>
### <a name="callbacks_validation">Validation</a> ### <a name="script_validation">Validation</a>
Fields of the form are validated by Scriptform before the script is called. Fields of the form are validated by Scriptform before the script is called.
Exactly what is validated depends on the options specified in the Form Exactly what is validated depends on the options specified in the Form
Definition. For more info on that, see the *Field Types* section of this Definition. For more info on that, see the *Field Types* section of this
manual. manual.
### <a name="callbacks_fieldvalues">Field values</a> ### <a name="script_fieldvalues">Field values</a>
Field values are passed to the script in its environment. For instance, a form Field values are passed to the script in its environment. For instance, a form
field definition: field definition:

Loading…
Cancel
Save