|
|
@ -8,27 +8,7 @@ require(__DIR__ . '/../hesk_settings.inc.php');
|
|
|
|
|
|
|
|
|
|
|
|
// Controllers
|
|
|
|
// Controllers
|
|
|
|
require(__DIR__ . '/controllers/CategoryController.php');
|
|
|
|
require(__DIR__ . '/controllers/CategoryController.php');
|
|
|
|
|
|
|
|
hesk_load_api_database_functions();
|
|
|
|
|
|
|
|
|
|
|
|
class HomeController
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function get($i){
|
|
|
|
|
|
|
|
echo 'You have got to home :) Val:' . intval($i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function post(){
|
|
|
|
|
|
|
|
echo 'You have posted to home';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function put(){
|
|
|
|
|
|
|
|
echo 'You have put to home';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function delete(){
|
|
|
|
|
|
|
|
echo 'You have deleted the home :(';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handle404() {
|
|
|
|
function handle404() {
|
|
|
|
http_response_code(404);
|
|
|
|
http_response_code(404);
|
|
|
@ -43,7 +23,8 @@ function assertApiIsEnabled() {
|
|
|
|
Link::before('assertApiIsEnabled');
|
|
|
|
Link::before('assertApiIsEnabled');
|
|
|
|
|
|
|
|
|
|
|
|
Link::all(array(
|
|
|
|
Link::all(array(
|
|
|
|
'/' => 'assertApiIsEnabled',
|
|
|
|
// Categories
|
|
|
|
'/test/{i}' => '\Controllers\Category\CategoryController',
|
|
|
|
'/v1/categories' => '\Controllers\Category\CategoryController::printAllCategories',
|
|
|
|
|
|
|
|
'/v1/categories/{i}' => '\Controllers\Category\CategoryController',
|
|
|
|
'404' => 'handle404'
|
|
|
|
'404' => 'handle404'
|
|
|
|
));
|
|
|
|
));
|