# MessageInterface

Chevere\Interfaces\Message\MessageInterface

view source (opens new window)

# Extends

# Description

Describes the component in charge of handling rich system messages for CLI and HTML.

# Constants

# CLI_TABLE

Type array

array (
  'emphasis' => 
  array (
    'bold' => 3,
  ),
  'strong' => 
  array (
    'bold' => 1,
  ),
  'underline' => 
  array (
    'bold' => 4,
  ),
  'code' => 
  array (
    'bg' => 37,
    'fg' => 30,
  ),
)

# HTML_TABLE

Type array

array (
  'emphasis' => 'em',
  'underline' => 'u',
)

# Methods

# __construct

Parameters

  • template: string

# template

Provides access to the message template.

Return

string


# trTable

Provides access to the message translation table.

Return

array


# toConsole

Returns a console message representation.

Return

string


# toHtml

Returns a HTML message representation.

Return

string


# toString

Returns a text message representation.

Return

string


# strtr

Return an instance with the specified string translation.

Parameters

  • search: string
  • replace: string

Return

self

This method MUST retain the state of the current instance, and return an instance that contains the specified string translation.


# emphasis

Return an instance with the specified $search replaced with $replace emphasis tag.

Parameters

  • search: string
  • replace: string

Return

self

This method MUST retain the state of the current instance, and return an instance that contains the specified $search replaced with $replace emphasis tag.


# strong

Return an instance with the specified $search replaced with $replace as strong tag.

Parameters

  • search: string
  • replace: string

Return

self

This method MUST retain the state of the current instance, and return an instance that contains the specified $search replaced with $replace as strong tag.


# underline

Return an instance with the specified underline.

Parameters

  • search: string
  • replace: string

Return

self

This method MUST retain the state of the current instance, and return an instance that contains the specified underline.


# code

Return an instance with the specified $search replaced with $replace as code tag.

Parameters

  • search: string
  • replace: string

Return

self

This method MUST retain the state of the current instance, and return an instance that contains the specified $search replaced with $replace as code tag.


Last Updated: 4/15/2021, 2:09:31 PM