当前位置: 首页>>代码示例>>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;未经允许,请勿转载。