當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSession::unsetValue方法代碼示例

本文整理匯總了PHP中CSession::unsetValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSession::unsetValue方法的具體用法?PHP CSession::unsetValue怎麽用?PHP CSession::unsetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSession的用法示例。


在下文中一共展示了CSession::unsetValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doAction

 protected function doAction()
 {
     $data = ['theme' => getUserTheme(CWebUser::$data), 'messages' => []];
     if (CSession::keyExists('messages')) {
         $data['messages'] = CSession::getValue('messages');
         CSession::unsetValue(['messages']);
     }
     $this->setResponse(new CControllerResponseData($data));
 }
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:9,代碼來源:CControllerSystemWarning.php

示例2: local_showMessage

function local_showMessage()
{
    global $ZBX_MESSAGES;
    if (CSession::keyExists('messageOk') || CSession::keyExists('messageError')) {
        if (CSession::keyExists('messages')) {
            $ZBX_MESSAGES = CSession::getValue('messages');
            CSession::unsetValue(['messages']);
        }
        if (CSession::keyExists('messageOk')) {
            show_messages(true, CSession::getValue('messageOk'));
        } else {
            show_messages(false, null, CSession::getValue('messageError'));
        }
        CSession::unsetValue(['messageOk', 'messageError']);
    }
}
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:16,代碼來源:layout.htmlpage.php

示例3: CView

$message_error = null;
$messages = [];
// this code show messages generated by MVC pages
if (CSession::keyExists('messageOk') || CSession::keyExists('messageError')) {
    if (CSession::keyExists('messages')) {
        $messages = CSession::getValue('messages');
        CSession::unsetValue(['messages']);
    }
    if (CSession::keyExists('messageOk')) {
        $message_good = true;
        $message_ok = CSession::getValue('messageOk');
    } else {
        $message_good = false;
        $message_error = CSession::getValue('messageError');
    }
    CSession::unsetValue(['messageOk', 'messageError']);
}
if (!defined('ZBX_PAGE_NO_MENU')) {
    $pageMenu = new CView('layout.htmlpage.menu', ['server_name' => isset($ZBX_SERVER_NAME) ? $ZBX_SERVER_NAME : '', 'menu' => ['main_menu' => $main_menu, 'sub_menus' => $sub_menus, 'selected' => $page['menu']], 'user' => ['is_guest' => CWebUser::isGuest(), 'alias' => CWebUser::$data['alias'], 'name' => CWebUser::$data['name'], 'surname' => CWebUser::$data['surname']]]);
    echo $pageMenu->getOutput();
}
if ($page['type'] == PAGE_TYPE_HTML) {
    echo '<div class="' . ZBX_STYLE_ARTICLE . '">';
}
// unset multiple variables
unset($table, $top_page_row, $menu_table, $main_menu_row, $sub_menu_table, $sub_menu_rows);
if ($page['type'] == PAGE_TYPE_HTML && $showGuiMessaging) {
    zbx_add_post_js('initMessages({});');
}
// if a user logs in after several unsuccessful attempts, display a warning
if ($failedAttempts = CProfile::get('web.login.attempt.failed', 0)) {
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:page_header.php

示例4: validateInput

 /**
  * Validate input parameters.
  *
  * @return var
  */
 public function validateInput($validationRules)
 {
     if (CSession::keyExists('formData')) {
         $input = array_merge($_REQUEST, CSession::getValue('formData'));
         CSession::unsetValue(['formData']);
     } else {
         $input = $_REQUEST;
     }
     $validator = new CNewValidator($input, $validationRules);
     foreach ($validator->getAllErrors() as $error) {
         info($error);
     }
     if ($validator->isErrorFatal()) {
         $this->validationResult = self::VALIDATION_FATAL_ERROR;
     } else {
         if ($validator->isError()) {
             $this->input = $validator->getValidInput();
             $this->validationResult = self::VALIDATION_ERROR;
         } else {
             $this->input = $validator->getValidInput();
             $this->validationResult = self::VALIDATION_OK;
         }
     }
     return $this->validationResult == self::VALIDATION_OK;
 }
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:30,代碼來源:CController.php


注:本文中的CSession::unsetValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。