forked from sihaoo/router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
37 lines (26 loc) · 932 Bytes
/
action.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
<?php
namespace access\controller;
require_once('tools/object/tool.php');
require_once('tools/router/router.php');
require_once('tools/writer/writer.php');
use tools\constants\Tool as Tool;
use tools\router\Router as Router;
use tools\writer\Writer as Writer;
class Action extends Router {
public function __construct($route) {
parent::__construct($route);
echo 'ENTERED ACTION <br/>';
print_r(parent::get_route()->get_request_path());
$this->execute_request();
$this->route_complete();
}
//handles the get request (used for retrieve records)
public function get() { echo 'action get'; }
//handles the post request (used to create records)
public function post() { echo 'action post'; }
//handles the put request (used to update records)
public function put() { echo 'action put'; }
//handles the delete request (used to remove records)
public function delete() { echo 'action delete'; }
}
?>