class FormatterHelper extends Helper
The Formatter class provides helpers to format messages.
protected | $helperSet | from Helper |
setHelperSet(HelperSet $helperSet = null) Sets the helper set associated with this helper. | from Helper | |
HelperSet | getHelperSet() Gets the helper set associated with this helper. | 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 | formatTime($secs) | from Helper |
static | formatMemory($memory) | from Helper |
static | strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) | from Helper |
static | removeDecoration(OutputFormatterInterface $formatter, $string) | 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. |
Sets the helper set associated with this helper.
HelperSet | $helperSet |
Gets the helper set associated with this helper.
HelperSet | A HelperSet instance |
Returns the length of a string, using mb_strwidth if it is available.
string | $string | The string to check its length |
int | The length of the string |
Returns the subset of a string, using mb_substr if it is available.
string | $string | String to subset |
int | $from | Start offset |
int|null | $length | Length to read |
string | The string subset |
$secs |
$memory |
OutputFormatterInterface | $formatter | |
$string |
OutputFormatterInterface | $formatter | |
$string |
Formats a message within a section.
string | $section | The section name |
string | $message | The message |
string | $style | The style to apply to the section |
string | The format section |
Formats a message as a block of text.
string|array | $messages | The message to write in the block |
string | $style | The style to apply to the whole block |
bool | $large | Whether to return a large block |
string | The formatter message |
Truncates a message to the given length.
string | $message | |
int | $length | |
string | $suffix |
string |
Returns the canonical name of this helper.
string | The canonical name |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Helper/FormatterHelper.html