PHP 클래스 Contao\Message

The class handles system messages which are shown to the user. You can add messages from anywhere in the application. Usage: Message::addError('Please enter your name'); Message::addConfirm('The data has been stored'); Message::addInfo('You can upload only two files'); Message::addNew('There are two new messages');
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

공개 메소드들

메소드 설명
add ( string $strMessage, string $strType, string $strScope = TL_MODE ) Add a message
addConfirmation ( string $strMessage, string $strScope = TL_MODE ) Add a confirmation message
addError ( string $strMessage, string $strScope = TL_MODE ) Add an error message
addInfo ( string $strMessage, string $strScope = TL_MODE ) Add an info message
addNew ( string $strMessage, string $strScope = TL_MODE ) Add a new message
addRaw ( string $strMessage, string $strScope = TL_MODE ) Add a preformatted message
generate ( string $strScope = TL_MODE ) : string Return the messages with a wrapping container as HTML
generateUnwrapped ( string $strScope = TL_MODE ) : string Return the messages as HTML
getTypes ( ) : array Return all available message types
hasConfirmation ( string $strScope = TL_MODE ) : boolean Check if there are confirmation messages
hasError ( string $strScope = TL_MODE ) : boolean Check if there are error messages
hasInfo ( string $strScope = TL_MODE ) : boolean Check if there are info messages
hasMessages ( string $strScope = TL_MODE ) : boolean Check if there are any messages
hasNew ( string $strScope = TL_MODE ) : boolean Check if there are new messages
hasRaw ( string $strScope = TL_MODE ) : boolean Check if there are raw messages
reset ( ) Reset the message system

보호된 메소드들

메소드 설명
getFlashBagKey ( string $strType, string | null $strScope = TL_MODE ) : string Return the flash bag key

메소드 상세

add() 공개 정적인 메소드

Add a message
public static add ( string $strMessage, string $strType, string $strScope = TL_MODE )
$strMessage string The message text
$strType string The message type
$strScope string An optional message scope

addConfirmation() 공개 정적인 메소드

Add a confirmation message
public static addConfirmation ( string $strMessage, string $strScope = TL_MODE )
$strMessage string The confirmation message
$strScope string An optional message scope

addError() 공개 정적인 메소드

Add an error message
public static addError ( string $strMessage, string $strScope = TL_MODE )
$strMessage string The error message
$strScope string An optional message scope

addInfo() 공개 정적인 메소드

Add an info message
public static addInfo ( string $strMessage, string $strScope = TL_MODE )
$strMessage string The info message
$strScope string An optional message scope

addNew() 공개 정적인 메소드

Add a new message
public static addNew ( string $strMessage, string $strScope = TL_MODE )
$strMessage string The new message
$strScope string An optional message scope

addRaw() 공개 정적인 메소드

Add a preformatted message
public static addRaw ( string $strMessage, string $strScope = TL_MODE )
$strMessage string The preformatted message
$strScope string An optional message scope

generate() 공개 정적인 메소드

Return the messages with a wrapping container as HTML
public static generate ( string $strScope = TL_MODE ) : string
$strScope string An optional message scope
리턴 string The messages HTML markup

generateUnwrapped() 공개 정적인 메소드

Return the messages as HTML
public static generateUnwrapped ( string $strScope = TL_MODE ) : string
$strScope string An optional message scope
리턴 string The messages HTML markup

getFlashBagKey() 보호된 정적인 메소드

Return the flash bag key
protected static getFlashBagKey ( string $strType, string | null $strScope = TL_MODE ) : string
$strType string The message type
$strScope string | null The message scope
리턴 string The flash bag key

getTypes() 공개 정적인 메소드

Return all available message types
public static getTypes ( ) : array
리턴 array An array of message types

hasConfirmation() 공개 정적인 메소드

Check if there are confirmation messages
public static hasConfirmation ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are confirmation messages

hasError() 공개 정적인 메소드

Check if there are error messages
public static hasError ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are error messages

hasInfo() 공개 정적인 메소드

Check if there are info messages
public static hasInfo ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are info messages

hasMessages() 공개 정적인 메소드

Check if there are any messages
public static hasMessages ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are messages

hasNew() 공개 정적인 메소드

Check if there are new messages
public static hasNew ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are new messages

hasRaw() 공개 정적인 메소드

Check if there are raw messages
public static hasRaw ( string $strScope = TL_MODE ) : boolean
$strScope string An optional message scope
리턴 boolean True if there are raw messages

reset() 공개 정적인 메소드

Reset the message system
public static reset ( )