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


PHP CRM_Utils_String::match方法代碼示例

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


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

示例1: pushUserContext

 /**
  * Adds a userContext to the stack.
  *
  * @param string $userContext
  *   The url to return to when done.
  * @param bool $check
  *   Should we do a dupe checking with the top element.
  *
  * @return void
  */
 public function pushUserContext($userContext, $check = TRUE)
 {
     if (empty($userContext)) {
         return;
     }
     $this->createScope(self::USER_CONTEXT);
     // hack, reset if too big
     if (count($this->_session[$this->_key][self::USER_CONTEXT]) > 10) {
         $this->resetScope(self::USER_CONTEXT);
         $this->createScope(self::USER_CONTEXT);
     }
     $topUC = array_pop($this->_session[$this->_key][self::USER_CONTEXT]);
     // see if there is a match between the new UC and the top one. the match needs to be
     // fuzzy since we use the referer at times
     // if close enough, lets just replace the top with the new one
     if ($check && $topUC && CRM_Utils_String::match($topUC, $userContext)) {
         array_push($this->_session[$this->_key][self::USER_CONTEXT], $userContext);
     } else {
         if ($topUC) {
             array_push($this->_session[$this->_key][self::USER_CONTEXT], $topUC);
         }
         array_push($this->_session[$this->_key][self::USER_CONTEXT], $userContext);
     }
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:34,代碼來源:Session.php

示例2: pushUserContext

 /**
  * adds a userContext to the stack
  *
  * @param string  $userContext the url to return to when done
  * @param boolean $check       should we do a dupe checking with the top element
  * @return void
  *
  * @access public
  * 
  */
 function pushUserContext($userContext, $check = true)
 {
     if (empty($userContext)) {
         return;
     }
     $this->createScope(CRM_CORE_SESSION_USER_CONTEXT);
     // hack, reset if too big
     if (count($this->_session[$this->_key][CRM_CORE_SESSION_USER_CONTEXT]) > 10) {
         $this->resetScope(CRM_CORE_SESSION_USER_CONTEXT);
         $this->createScope(CRM_CORE_SESSION_USER_CONTEXT);
     }
     $topUC = array_pop($this->_session[$this->_key][CRM_CORE_SESSION_USER_CONTEXT]);
     // see if there is a match between the new UC and the top one. the match needs to be
     // fuzzy since we use the referer at times
     if ($check && $topUC && CRM_Utils_String::match($topUC, $userContext)) {
         array_push($this->_session[$this->_key][CRM_CORE_SESSION_USER_CONTEXT], $topUC);
     } else {
         if ($topUC) {
             array_push($this->_session[$this->_key][CRM_CORE_SESSION_USER_CONTEXT], $topUC);
         }
         array_push($this->_session[$this->_key][CRM_CORE_SESSION_USER_CONTEXT], $userContext);
     }
     // CRM_Core_Error::debug( 'UC', $this->_session[$this->_key][self::USER_CONTEXT] );
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:34,代碼來源:Session.php


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