本文整理匯總了PHP中TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getErrorFlashMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActionController::getErrorFlashMessage方法的具體用法?PHP ActionController::getErrorFlashMessage怎麽用?PHP ActionController::getErrorFlashMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Extbase\Mvc\Controller\ActionController
的用法示例。
在下文中一共展示了ActionController::getErrorFlashMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getErrorFlashMessage
/**
* Looks for form error message in localization file.
*
* First tries 'form-errors-{controller}-{action}', then
* tries 'form-errors-{controller}' for translation.
*
* {controller} and {action} are lowercase
*
* @return NULL|string
*/
protected function getErrorFlashMessage()
{
$action = strtolower($this->request->getControllerActionName());
$controller = strtolower($this->request->getControllerName());
$ext = $this->request->getControllerExtensionName();
$message = LocalizationUtility::translate("form-errors-{$controller}-{$action}", $ext);
if ($message) {
return $message;
}
$message = LocalizationUtility::translate("form-errors-{$controller}", $ext);
if ($message) {
return $message;
}
return parent::getErrorFlashMessage();
}
示例2: getErrorFlashMessage
/**
* @return string
*/
protected function getErrorFlashMessage()
{
$getValidationResults = $this->arguments->getValidationResults();
if ($getValidationResults->hasErrors()) {
$errorMsg = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_cart.error.validation', $this->extensionName);
} else {
$errorMsg = parent::getErrorFlashMessage();
}
return $errorMsg;
}
示例3: getErrorFlashMessage
/**
* Override getErrorFlashMessage to present
* nice flash error messages.
*
* @return string
*/
protected function getErrorFlashMessage()
{
$defaultFlashMessage = parent::getErrorFlashMessage();
$locallangKey = sprintf('error.%s.%s', lcfirst($this->request->getControllerName()), $this->actionMethodName);
return $this->translate($locallangKey, $defaultFlashMessage);
}
示例4: getErrorFlashMessage
/**
* Handle default flash messages
*
* @return string
*/
protected function getErrorFlashMessage()
{
$msg = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('controller-login-genericActionMessage-' . $this->actionMethodName, 'cicregister');
if (!$msg) {
return parent::getErrorFlashMessage();
}
return $msg;
}