本文整理汇总了PHP中controller::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP controller::logout方法的具体用法?PHP controller::logout怎么用?PHP controller::logout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类controller
的用法示例。
在下文中一共展示了controller::logout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettext
case 'in_pool':
if ($ctr->pool->insert($_POST)) {
$ctr->view("pool", $_SESSION['role']);
} else {
$ctr->view("error", $_SESSION['role'], null, gettext("Empty fields on the insert form."));
}
break;
// Stats action
// Stats action
case 'stat':
$ctr->view("stat", $_SESSION['role']);
break;
// Logout action
// Logout action
case 'logout':
$ctr->logout();
break;
case 'vote':
// The user votes, so it cannot vote again until the field voted from the user table is restored to 0, and adds
// one vote for the project.
$ctr->poll->user_voted($_SESSION['userid'], $_POST['vote']);
// Loads the welcome web page for the user
$ctr->view("start", $_SESSION['role']);
break;
// Default screen
// Default screen
default:
$ctr->view("start", $_SESSION['role']);
break;
}
} else {
示例2: function
require '../Slim/Slim.php';
include 'controller.class.php';
include 'utils/web_util.class.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
$app->response->headers->set('Content-Type', 'application/json');
// test method :-)
$app->get('/api/hello/:name', function ($name) {
echo $name;
});
// Route for login
$app->post('/api/login/:userid', 'loginUser');
$app->post('/api/login/user/:user', 'loginUserWithUsername');
$app->get('/api/logout/:id', function ($id) {
$hiddenSweet = new controller();
echo $hiddenSweet->logout($id);
});
$app->post('/api/register/', 'registerUser');
// Glucose Lebvels
$app->post('/api/glucose/', 'addNewGlucoseValue');
$app->get('/api/glucose/u/:user/t/:token', 'getAllGlucoseValues');
$app->get('/api/glucose/year/:year', 'getAllGlucoseValuesFromYear');
$app->get('/api/glucose/u/:user/t/:token/month/:month', 'getAllGlucoseValuesFromMonth');
$app->get('/api/glucose/month/:month/type/:type', 'getAllGlucoseValuesFromMonthAndType');
// Meals
$app->post('/api/meals/', function () {
$util = new web_util();
$value = $util->readContentFormRequest(Slim::getInstance()->request());
$hiddenSweet = new controller();
echo $hiddenSweet->addNewMeal($value);
});