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


PHP ActionController::addFlashMessage方法代碼示例

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


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

示例1: addFlashMessage

 /**
  * @param string $messageBody
  * @param string $messageTitle
  * @param int $severity
  * @param bool $storeInSession
  */
 public function addFlashMessage($messageBody, $messageTitle = '', $severity = AbstractMessage::OK, $storeInSession = true)
 {
     if (null === $this->controllerContext) {
         $this->controllerContext = $this->buildControllerContext();
     }
     parent::addFlashMessage($messageBody, $messageTitle, $severity, $storeInSession);
 }
開發者ID:vertexvaar,項目名稱:election,代碼行數:13,代碼來源:AbstractBeController.php

示例2: addFlashMessage

 /**
  * Creates a Message object and adds it to the FlashMessageQueue.
  *
  * NOTE: This is a Backport of the 6.2 implementation!
  *
  * @param string $messageBody The message
  * @param string $messageTitle Optional message title
  * @param integer $severity Optional severity, must be one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
  * @param boolean $storeInSession Optional, defines whether the message should be stored in the session (default) or not
  * @return void
  * @throws \InvalidArgumentException if the message body is no string
  * @see \TYPO3\CMS\Core\Messaging\FlashMessage
  */
 public function addFlashMessage($messageBody, $messageTitle = '', $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::OK, $storeInSession = TRUE)
 {
     if (version_compare(TYPO3_version, '6.2.0', '>=')) {
         parent::addFlashMessage($messageBody, $messageTitle, $severity, $storeInSession);
     } else {
         if (!is_string($messageBody)) {
             throw new \InvalidArgumentException('The message body must be of type string, "' . gettype($messageBody) . '" given.', 1243258395);
         }
         /* @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
         $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $messageBody, $messageTitle, $severity, $storeInSession);
         $this->controllerContext->getFlashMessageQueue()->enqueue($flashMessage);
     }
 }
開發者ID:punktDe,項目名稱:solr,代碼行數:26,代碼來源:AbstractModuleController.php

示例3: addFlashMessage

 /**
  * Add flash message (with auto translation handling title and body)
  *
  * @param string $messageBody
  * @param string $messageTitle
  * @param int $severity
  * @param array $arguments the arguments of the extension, being passed over to vsprintf
  * @param bool $storeInSession
  */
 public function addFlashMessage($messageBody, $messageTitle = '', $severity = AbstractMessage::OK, array $arguments = NULL, $storeInSession = TRUE)
 {
     parent::addFlashMessage($messageBody ? LocalizationUtility::translate($messageBody, $this->extensionName, $arguments) ?: $messageBody : '', $messageTitle ? LocalizationUtility::translate($messageTitle, $this->extensionName, $arguments) ?: $messageTitle : '', $severity, $storeInSession);
 }
開發者ID:ruudsilvrants,項目名稱:news_importer,代碼行數:13,代碼來源:AdminController.php

示例4: addFlashMessage

 /**
  * Creates a Message object and adds it to the FlashMessageQueue.
  *
  * @param string $messageBody The message
  * @param string $messageTitle Optional message title
  * @param integer $severity Optional severity, must be one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
  * @param boolean $storeInSession Optional, defines whether the message should be stored in the session (default) or not
  * @return void
  * @throws \InvalidArgumentException if the message body is no string
  * @see \TYPO3\CMS\Core\Messaging\FlashMessage
  * @api
  */
 public function addFlashMessage($messageBody, $messageTitle = '', $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::OK, $storeInSession = TRUE)
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()) >= 6002000) {
         parent::addFlashMessage($messageBody, $messageTitle, $severity, $storeInSession);
     } else {
         $this->flashMessageContainer->add($messageTitle, $messageBody, $severity);
     }
 }
開發者ID:raimundlandig,項目名稱:winkel.de-DEV,代碼行數:20,代碼來源:ManagerController.php


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