You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test.md
+320-2Lines changed: 320 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
#####BismillahHirahManNirRaheem
1
+
#####BismillahHirahManNirRaheem#########
2
2
3
3
#JSON-PHP Form Handler & Data-validator
4
4
---------------------------------------
@@ -18,7 +18,7 @@ It is very easy to integrate JSON-PHP Handler & Data-validator in your website/w
18
18
"Gender":["Male","Female"]
19
19
}'); //json_form() accepts JSON form format as argument
20
20
21
-
##Json Form Structure
21
+
##Json Form Structure##
22
22
In **JSON-PHP Handler & Data-validator** a specialized Json form structure if provided during the declariation of object in the parameter or using `json_string($string)` function.
23
23
24
24
The name part of json string defines the name attribte of `<input>` and the value defines its property (type attribute). The form is parsed according to the property. We can use JSON Property Generator to generate form rules.
@@ -119,3 +119,321 @@ The name part of json string defines the name attribte of `<input>` and the valu
<p class="tableblock">It defines the rules for validation during <code>json_handle_request()</code></p>
234
+
</td>
235
+
<td class="tableblock halign-left valign-top">
236
+
<p class="tableblock">It accepts rules like <code>min</code> <code>max</code> <code>preg</code> and even helper function to process data efficiently. For more
<p class="tableblock">It requires two parameters one is the <code><input></code> name as <code>$key</code> and second mime extension passed as
272
+
array.
273
+
</p>
274
+
<p class="tableblock">The file location is defined by <code>$obj_name→json_upload_dir</code></p>
275
+
</td>
276
+
</tr>
277
+
</tbody>
278
+
</table>
279
+
280
+
###Helper function###
281
+
282
+
Before moving ahead lets first learn what an helper function is? A helper function is a arbitrary function which is called during data processing to extend the process by running desired operation on data. It is not the part of Library but it is always user defined and is called by Library during standard operation.
283
+
284
+
JSON-PHP Handler & Data-validator often uses helper function to give developer free hand to manipulate the data according to their requirement. There are two helper function which are required by JSON-PHP Handler & Data-validator's methods.
285
+
286
+
- Template Function
287
+
- Validation Function
288
+
289
+
###Template Function
290
+
291
+
It is an user defined function which provides HTML template structure for table. It need to have four parameters: name type value and result (for <options/> input). It doesn’t return anything but it prints directly html code during execution.
Validation Function is also a helper function which is used to validate and modify data submitted by forms. It expectes one parameter and return the data after modification/validation.
Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. JSON-PHP Handler & Data-validator provides a handy way to validate data. The rules are passed in json format through json_secureRule($rule) function. The name part of JSON string should be the input name of form element and the rule should be passed as a value to it in JSON-ARRAY [] format. main_rule is the global rule for all inputs. You can use validation rules for normally submitted form also.
364
+
365
+
The valid rules of JSON-PHP Handler & Data-validator are:
0 commit comments