FormatterHelper
class FormatterHelper extends Helper
The Formatter class provides helpers to format messages.
Properties
protected | $helperSet | from Helper |
Methods
from Helper
static int
strlen(string $string)
Returns the length of a string, using mb_strwidth if it is available.
from Helper
static string
substr(string $string, int $from, int|null $length = null)
Returns the subset of a string, using mb_substr if it is available.
from Helper
static
from Helper
string
formatSection(string $section, string $message, string $style = 'info')
Formats a message within a section.
string
formatBlock(string|array $messages, string $style, bool $large = false)
Formats a message as a block of text.
string
truncate(string $message, int $length, string $suffix = '...')
Truncates a message to the given length.
string
getName()
Returns the canonical name of this helper.
Details
static int
strlen(string $string)
Returns the length of a string, using mb_strwidth if it is available.
static string
substr(string $string, int $from, int|null $length = null)
Returns the subset of a string, using mb_substr if it is available.
string
formatSection(string $section, string $message, string $style = 'info')
Formats a message within a section.
string
formatBlock(string|array $messages, string $style, bool $large = false)
Formats a message as a block of text.