本文整理汇总了PHP中ST::redirectToRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP ST::redirectToRoute方法的具体用法?PHP ST::redirectToRoute怎么用?PHP ST::redirectToRoute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ST
的用法示例。
在下文中一共展示了ST::redirectToRoute方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storeRequest
public function storeRequest($vks_id)
{
try {
$vks = Vks::with('tech_support_requests')->findOrFail($vks_id);
} catch (Exception $e) {
$this->error('404');
}
$request = $this->request->request;
$this->validator->validate(['Сообщение' => [$request->get('user_message'), 'max(255)'], 'Точка' => [$request->get('att_id'), 'required|int']]);
//if no passes
if (!$this->validator->passes()) {
$this->backWithData($this->validator->errors()->all());
}
$request_new = new TechSupportRequest(array('att_id' => $request->get('att_id'), 'vks_id' => $vks->id, 'owner_id' => App::$instance->user->id, 'user_message' => $request->get('user_message'), 'status' => $vks->status == VKS_STATUS_APPROVED ? TechSupportRequest::STATUS_READY_FOR_SEND : TechSupportRequest::STATUS_WAIT_VKS_DECISION));
$flag = false;
if (count($vks->tech_support_requests)) {
foreach ($vks->tech_support_requests as $request) {
if ($request_new->att_id == $request->att_id) {
$flag = true;
}
}
}
if (!$flag) {
$request_new->save();
}
App::$instance->MQ->setMessage("Запрос успешно создан");
ST::redirectToRoute('TechSupport/showRequests/' . $vks->id);
}
示例2: delete
public function delete($id)
{
$this->isDefaultUserIteractBlock($id);
Auth::isAdminOrDie(App::$instance);
$initiator = Initiator::findorFail($id);
$initiator->delete();
App::$instance->MQ->setMessage("Успешно удалено");
App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'Инициатор удален' . $initiator->name);
ST::redirectToRoute('Initiators/index');
}
示例3: logout
public function logout()
{
global $_TB_IDENTITY;
if (Auth::isLogged(App::$instance)) {
setcookie(md5("logged" . $_TB_IDENTITY[App::$instance->user->origin]['serviceName']), false, time() - 3600, '/', Null, 0);
} else {
App::$instance->MQ->setMessage('Вы не авторизированы');
}
ST::redirectToRoute("Index/index");
}
示例4: delete
public function delete($id)
{
Auth::isAdminOrDie(App::$instance);
if ($id == 1) {
App::$instance->MQ->setMessage("Это удалить нельзя, просто переименуйте как вам нужно");
ST::redirect('back');
}
$department = Department::findorFail($id);
$department->delete();
App::$instance->MQ->setMessage("Успешно удалено");
App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'Подразделение удалено' . $department->name);
ST::redirectToRoute('Departments/index');
}
示例5: parseUri
protected function parseUri()
{
$path = isset($_GET['route']) ? $_GET['route'] : ST::redirectToRoute('Index/index');
$path = trim(parse_url($path, PHP_URL_PATH), "/");
@(list($controller, $action, $params) = explode("/", $path, 3));
$mv = new Middleware();
$mv->ProcessCheck($mv->CheckRequestedRoute(strtolower($controller), strtolower($action)));
if (isset($controller)) {
$this->setController($controller);
}
if (isset($action)) {
$this->setAction($action);
}
if (isset($params)) {
$this->setParams(explode("/", $params));
}
}
示例6: __construct
function __construct()
{
if (isset($_GET['r'])) {
//разбить запрос
$splitReq = explode('/', $_GET['r']);
//получить имя файла, достать последний массив из конца сстроки запроса
$this->filename = array_pop($splitReq);
//все остальное в массиве, это путь к файлу
$this->sect = $splitReq;
//process request
$this->processRequest();
} else {
if (isset($_GET['route'])) {
$frontController = new FrontController();
$frontController->run();
exit;
}
ST::redirectToRoute("Index/index");
}
}
示例7: delete
public function delete($blocked_time_id)
{
$block = BlockedTime::findOrFail($blocked_time_id);
$block->delete();
App::$instance->log->logWrite(LOG_CONFIG_CHANGE, "Блокировка {$block->start_at} - {$block->end_at}, {$block->blocked_type_named} удалена");
App::$instance->MQ->setMessage("Блокировка удалена");
ST::redirectToRoute('BlockedTime/index');
}
示例8: storeHelp
public function storeHelp()
{
Token::checkToken();
$xml = new SimpleXMLElement('<root/>');
if ($this->request->request->has('help')) {
foreach ($this->request->request->get('help') as $help) {
$this->validator->validate([$help['humanized'] => [$help['content'], 'required|max(320)']]);
//if no passes
if (!$this->validator->passes()) {
$this->putUserDataAtBackPack($this->request);
App::$instance->MQ->setMessage($this->validator->errors()->all());
ST::redirect("back");
}
$srvXml = $xml->addChild('element');
$srvXml->addChild('humanized', $help['humanized']);
$srvXml->addChild('name', $help['name']);
$srvXml->addChild('content', $help['content']);
}
$xml->asXML("config/help_standart.xml");
App::$instance->MQ->setMessage('Список обновлен');
App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'изменены сообщения помощи');
} else {
App::$instance->MQ->setMessage('Нет обязательного параметра');
}
return ST::redirectToRoute('index/index');
}
示例9: setcookie
<?php
ST::deployTemplate('heads/ui_timepicker.inc');
$init = App::get_instance();
RenderEngine::MenuChanger();
//login out from system
if (isset($_GET['drop'])) {
setcookie("Auth", "", time() - 3600);
ST::redirectToRoute("Index/index");
}
?>
<div class='container'>
<div class=' col-md-offset-2 col-md-8 block-border-shadow'>
<div class='col-md-offset-3 col-md-9'>
<form class='form-horizontal' method='post' action="<?php
echo ST::route("AuthNew/loginProcess");
?>
">
<div class='form-group'>
<h3>Войти в систему</h3>
<hr>
<div class="alert alert-danger">
Нет учетной записи? <a class='btn btn-link text-primary'
href="<?php
echo ST::route('AuthNew/register');
?>
">Зарегистрироваться можно тут
<span class="glyphicon glyphicon-link"></span></a>
<hr>
</div>
示例10: foreach
<?php
ST::deployTemplate('heads/ui_timepicker.inc');
RenderEngine::MenuChanger();
if (!Auth::isLogged(App::$instance)) {
App::$instance->MQ->setMessage('Создавать заявки могут только зарегистрированные пользователи, пожалуйста, войдите в систему или зарегистрируйтесь');
ST::redirectToRoute('AuthNew/login');
}
?>
<div class="container">
<div class="col-md-12">
<h3 class="text-muted heading-main">ВКС в нашем Планировщике созданные на основе ВКС ЦА <?php
echo ST::linkToCaVksPage($caVksId, true);
?>
</h3>
<hr>
<?php
if (count($vkses)) {
?>
<table class="table table-striped table-hover">
<th class="col-lg-1">id</th><th class="col-lg-2">Тема</th><th class="col-lg-2">Заказчик</th><th class="col-lg-5">Участники</th><th class="col-lg-2">Создана</th>
<th>Статус</th>
<?php
foreach ($vkses as $vks) {
?>
<tr>
<td><?php
echo ST::linkToVksPage($vks->id, true);
?>
</td>
示例11: approveToken
public function approveToken($userToken)
{
$user = User::where('token', $userToken)->first();
if (empty($user)) {
throw new Exception('Bad user token delivered');
}
$user->status = USER_STATUS_APPROVED;
$user->save();
App::$instance->MQ->setMessage("Спасибо за подтверждение, добро пожаловать.");
ST::redirectToRoute("Index/index");
}
示例12: reSubmitFromResults
public function reSubmitFromResults($reportNum)
{
if (!isset($_SESSION['savedResult_' . App::$instance->main->appkey]) || !isset($_SESSION['savedResult_' . App::$instance->main->appkey][$reportNum])) {
$this->error('no-object');
} else {
$pulledObject = $_SESSION['savedResult_' . App::$instance->main->appkey][$reportNum];
if ($pulledObject->isResult()) {
$this->error('no-object');
}
$req = new Request();
foreach ($pulledObject->getRequest() as $key => $val) {
$req->request->set($key, $val);
}
//set dates to one
$req->request->set('dates', array(array('date' => $pulledObject->getRequest()->get('date'), 'start_time' => $pulledObject->getRequest()->get('start_time'), 'end_time' => $pulledObject->getRequest()->get('end_time'))));
// dump($req);
// die;
$this->putUserDataAtBackPack($req);
ST::redirectToRoute('Vks/create');
}
}