You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
360 B
PHP
20 lines
360 B
PHP
<?php
|
|
|
|
// Special treatment for AJAX submissions
|
|
if(r::is('POST')) {
|
|
$fields = [];
|
|
foreach(r::data() as $field => $value) {
|
|
$fields[$field] = $form->hasError($field);
|
|
}
|
|
|
|
$data = [
|
|
'success' => $form->successful(),
|
|
'fields' => $fields,
|
|
'message' => $form->message()
|
|
];
|
|
|
|
echo response::json($data);
|
|
} else {
|
|
require_once('default.json.php');
|
|
}
|