PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/doc/core/z_validation.html

http://github.com/zotonic/zotonic
HTML | 54 lines | 45 code | 9 blank | 0 comment | 0 complexity | 8ac0d4ac29c7591f8a2b67428c910fb3 MD5 | raw file
 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2<html>
 3<head>
 4<title>Module z_validation</title>
 5<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
 6</head>
 7<body bgcolor="white">
 8<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
 9<hr>
10
11<h1>Module z_validation</h1>
12<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Handle parameter validation of a request.
13<p>Copyright Š 2009-2010  Marc Worrell</p>
14
15<p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
16
17<h2><a name="description">Description</a></h2>Handle parameter validation of a request. Checks for the presence
18  of z_v elements containing validation information.
19<h2><a name="index">Function Index</a></h2>
20<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#get_q-2">get_q/2</a></td><td>Simple utility function to get the 'q' value of an argument.</td></tr>
21<tr><td valign="top"><a href="#rename_args-1">rename_args/1</a></td><td>Rename validator arguments to names that are compatible with the LiveValidation plugin.</td></tr>
22<tr><td valign="top"><a href="#report_errors-2">report_errors/2</a></td><td>Add all errors as javascript message to the request result.</td></tr>
23<tr><td valign="top"><a href="#validate_query_args-1">validate_query_args/1</a></td><td>Checks for z_v arguments, performs enclosed checks and adds the validated terms to the q_validated list.</td></tr>
24</table>
25
26<h2><a name="functions">Function Details</a></h2>
27
28<h3 class="function"><a name="get_q-2">get_q/2</a></h3>
29<div class="spec">
30<p><tt>get_q(Name, Context) -&gt; any()</tt></p>
31</div><p>Simple utility function to get the 'q' value of an argument. When the argument has a generated unique prefix then
32  the prefix is stripped.</p>
33
34<h3 class="function"><a name="rename_args-1">rename_args/1</a></h3>
35<div class="spec">
36<p><tt>rename_args(Args::PropList) -&gt; PropList1</tt></p>
37</div><p>Rename validator arguments to names that are compatible with the LiveValidation plugin.</p>
38
39<h3 class="function"><a name="report_errors-2">report_errors/2</a></h3>
40<div class="spec">
41<p><tt>report_errors(T, Context) -&gt; any()</tt></p>
42</div><p>Add all errors as javascript message to the request result.</p>
43
44<h3 class="function"><a name="validate_query_args-1">validate_query_args/1</a></h3>
45<div class="spec">
46<p><tt>validate_query_args(Context) -&gt; {ok, NewContext} | {error, NewContext}</tt></p>
47</div><p>Checks for z_v arguments, performs enclosed checks and adds the validated terms to the q_validated list.
48       Errors are reported back to the user agent</p>
49<hr>
50
51<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
52<p><i>Generated by EDoc, Oct 13 2011, 14:45:56.</i></p>
53</body>
54</html>