예제 #1
0
파일: routes.php 프로젝트: tjbindseil/DB
    $xml = simplexml_load_string($str);
    print_r($xml);
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->get($routePrefix . 'hash/{password}', function ($password) {
    return password_hash($password, PASSWORD_BCRYPT);
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->get($routePrefix . 'hash/verify/{password}/{hashedPassword}', function ($password, $hashedPassword) {
    return password_verify($password, $hashedPassword);
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->post($routePrefix . 'student/add', function () {
    $con = new StudentController();
    return json_encode($con->addStudent());
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->post($routePrefix . 'student/delete', function () {
    $con = new StudentController();
    return $con->deleteStudent();
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->post($routePrefix . 'student/update', function () {
    $con = new StudentController();
    return json_encode($con->updateStudent());
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
$router->post($routePrefix . 'student/getAllStudents', function () {
    $con = new StudentController();
    return $con->getAllStudents();
}, array('before' => 'statsStart', 'after' => 'statsComplete'));
//INSERT/UPDATE and INSERT/UPDATE-like API calls
/*
Simple insert/update
	inserts or updates row in table with attributes objectArr
	if identifier in objectArr exists in table, update existing row with values in objectArr
	if not, insert new row with values in objectArr and auto-generated identifier