echo json_encode($ret_val); }); //TODO $app->get('/getblogtypelist', function () { require_once 'common/dbconnection.php'; $GLOBALS['mysqli'] = MySQLConnection::Open(); require_once 'posttype.php'; $retval = TypeFactory::GetTypes(); MySQLConnection::Close($GLOBALS['mysqli']); echo json_encode($retval); }); $app->get('/getcategorylist/', function () { require_once 'common/dbconnection.php'; $GLOBALS['mysqli'] = MySQLConnection::Open(); require_once 'category.php'; $retval = CategoryFactory::GetCategories(); MySQLConnection::Close($GLOBALS['mysqli']); echo json_encode($retval); }); $app->get('/getpublishedcategorylist/', function () { require_once 'common/dbconnection.php'; $GLOBALS['mysqli'] = MySQLConnection::Open(); require_once 'category.php'; $retval = CategoryFactory::GetPublishedCategories(); MySQLConnection::Close($GLOBALS['mysqli']); cors(); echo json_encode($retval); }); $app->get('/getcategoryblogs/:categoryid', function ($categoryid) { require_once 'common/dbconnection.php'; require_once 'category.php';