Alert
class Alert
Alert helper.
Constants
PADDING |
Alert padding. |
DEFAULT |
Default template. |
INFO |
Info template. |
SUCCESS |
Success template. |
WARNING |
Warning template. |
DANGER |
Danger template. |
Properties
protected Output | $output | Output instance. | |
protected int | $width | Alert width. | |
protected FormatterInterface|null | $formatter | Formatter. |
Methods
string
wordWrap(string $string, int $width)
Wraps a string to a given number of characters.
string
escape(string $string)
Escapes style tags if we have a formatter.
string
format(string $string)
Formats the string.
string
render(string $message, string $template = Alert::DEFAULT)
Renders an alert.
draw(string $message, string $template = Alert::DEFAULT, int $writer = Output::STANDARD)
Draws an alert.
Details
at line 96
__construct(Output $output, int|null $width = null)
Constructor.
at line 112
protected string
wordWrap(string $string, int $width)
Wraps a string to a given number of characters.
at line 123
protected string
escape(string $string)
Escapes style tags if we have a formatter.
at line 139
protected string
format(string $string)
Formats the string.
at line 162
string
render(string $message, string $template = Alert::DEFAULT)
Renders an alert.
at line 174
draw(string $message, string $template = Alert::DEFAULT, int $writer = Output::STANDARD)
Draws an alert.