Getting started on routing

This commit is contained in:
Mike Koch 2017-01-17 22:08:48 -05:00
parent f9845624d4
commit b7cbca03a7
2 changed files with 15 additions and 7 deletions

View File

@ -1,11 +1,8 @@
<?php
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
// Router: handles all REST requests to go to their proper place. Common dependency loading also happens here
require_once(__DIR__ . '/core/common.php');
require_once(__DIR__ . '/controllers/CategoryController.php');
hesk_load_api_database_functions();
$categories = \Controllers\Category\CategoryController::getAllCategories($hesk_settings);
// Returns the URI (or everything after the domain
$uri = $_SERVER["REQUEST_URI"];
output($categories);
//

11
api/testcategory.php Normal file
View File

@ -0,0 +1,11 @@
<?php
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
require_once(__DIR__ . '/core/common.php');
require_once(__DIR__ . '/controllers/CategoryController.php');
hesk_load_api_database_functions();
$categories = \Controllers\Category\CategoryController::getAllCategories($hesk_settings);
output($categories);