本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
}