Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions en/appendices/5-1-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Command
- ``bin/cake plugin list`` has been added to list all available plugins,
their load configuration and version.
- Optional ``Command`` arguments can now have a ``default`` value.
- ``BannerHelper`` was added. This command helper can format text as a banner
with a coloured background and padding.
- Additional default styles for ``info.bg``, ``warning.bg``, ``error.bg`` and
``success.bg`` were added to ``ConsoleOutput``.

Console
-------
Expand Down
20 changes: 20 additions & 0 deletions en/console-commands/input-output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ progress bar as necessary::
$progress->increment(4);
$progress->draw();

Banner Helper
-------------

The ``BannerHelper`` can be used to format one or more lines of text into
a banner with a background and horizontal padding::

$io->helper('Banner')
->withPadding(5)
->withStyle('success.bg')
->output(['Work complete']);

.. versionadded:: 5.1.0
The ``BannerHelper`` was added in 5.1

Getting User Input
==================
Expand Down Expand Up @@ -300,6 +313,10 @@ are several built-in styles, and you can create more. The built-in ones are
* ``info`` Informational messages. Cyan text.
* ``comment`` Additional text. Blue text.
* ``question`` Text that is a question, added automatically by shell.
* ``info.bg`` White background with cyan text.
* ``warning.bg`` Yellow background with black text.
* ``error.bg`` Red background with black text.
* ``success.bg`` Green background with black text.

You can create additional styles using ``$io->setStyle()``. To declare a
new output style you could do::
Expand Down Expand Up @@ -332,6 +349,9 @@ truthy value enables them.
Adding a style makes it available on all instances of ConsoleOutput as well,
so you don't have to redeclare styles for both stdout and stderr objects.

.. versionchanged:: 5.1.0
The ``info.bg``, ``warning.bg``, ``error.bg``, and ``success.bg`` were added.

Turning Off Coloring
====================

Expand Down