本文整理汇总了PHP中Index::logOut方法的典型用法代码示例。如果您正苦于以下问题:PHP Index::logOut方法的具体用法?PHP Index::logOut怎么用?PHP Index::logOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::logOut方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
if (isset($_GET['url'])) {
$segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'));
switch ($segments[1]) {
case 'index':
Index::setCtrl(new Home());
break;
case 'form':
Index::setCtrl(new Form());
break;
case 'form-results':
Index::setCtrl(new FormResults());
break;
case 'oczko':
Index::setCtrl(new Oczko());
break;
case 'angielski':
Index::setCtrl(new Ang());
break;
case 'add-article':
Index::setCtrl(new AddPost());
break;
case 'profile':
Index::setCtrl(new Profile());
break;
case 'administrator':
if (isset($segments[2])) {
$action = null;
if (isset($segments[3]) && ($segments[3] == 'edit' || $segments[3] == 'delete' || $segments[3] == 'add' || $segments[3] == 'activeblock' || $segments[3] == 'deleteAndMove')) {
if (isset($segments[4]) && is_int((int) $segments[4])) {
$action = ['action' => $segments[3], 'id' => (int) $segments[4]];
} else {
$action = ['action' => $segments[3]];
}
}
$mode = null;
switch ($segments[2]) {
case 'users':
Index::setCtrl(new Admin('users', $action));
break;
case 'categories':
Index::setCtrl(new Admin('categories', $action));
break;
}
}
break;
case 'clearSession':
session_destroy();
$this->redirect();
break;
case 'address-book':
if (!isset($segments[2])) {
Index::setCtrl(new AddressBook());
} else {
if ($segments[2] == 'add') {
Index::setCtrl(new AddressBook('add'));
} else {
if ($segments[2] == 'delete' || $segments[2] == 'edit') {
if (isset($segments[3])) {
Index::setCtrl(new AddressBook($segments[2], $segments[3]));
}
}
}
}
break;
case 'logout':
Index::logOut();
header('Location: /~ii293327/');
break;
default:
try {
switch ($segments[1]) {
case 'page':
if (is_int((int) $segments[2])) {
Index::setCtrl(new Home((int) $segments[2]));
}
break;
case 'article':
if (is_int((int) $segments[2])) {
Index::setCtrl(new ShowPost($segments[2]));
}
break;
case 'category':
if (is_int((int) $segments[2])) {
Index::setCtrl(new Home(null, (int) $segments[2]));
}
break;
default:
Index::setCtrl(new Error(404));
break;
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
} else {
Index::setCtrl(new Home());
}
}