-
Notifications
You must be signed in to change notification settings - Fork 0
/
Json.php
41 lines (28 loc) · 1.1 KB
/
Json.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php namespace components\custom_field; if(!defined('TX')) die('No direct access.');
class Json extends \dependencies\BaseComponent
{
/*
# The Json.php file
This is where you define REST calls.
They are mostly used for asynchronous operations, such as jQuery.restForm.
If you need the operation to cause a pageload, you probably need the Actions.php file.
REST calls are prefixed based on the request type.
For example, calling ?rest=component_name/function_name using an HTTP GET request
calls get_function_name in the corresponding Json.php file.
The prefixes:
HTTP GET = get_function_name
HTTP PUT = update_function_name
HTTP POST = create_function_name
HTTP DELETE = delete_function_name
Read more about actions here:
https://github.com/Tuxion/mokuji/wiki/Json.php
*/
public function create_test_configuration($data, $params)
{
mk('Sql')->model('custom_field', 'Configurations')
->configure($data->configuration, true);
return array(
'success' => true
);
}
}