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