File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
components/console/helpers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -303,8 +303,9 @@ Progress bars define a placeholder called ``message`` to display arbitrary
303303messages. However, none of the built-in formats include that placeholder, so
304304before displaying these messages, you must define your own custom format::
305305
306+ ProgressBar::setFormatDefinition('custom', ' %current%/%max% -- %message%');
307+
306308 $progressBar = new ProgressBar($output, 100);
307- $progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message%');
308309 $progressBar->setFormat('custom');
309310
310311Now, use the ``setMessage() `` method to set the value of the ``%message% ``
@@ -322,8 +323,9 @@ placeholder before displaying the progress bar::
322323Messages can be combined with custom placeholders too. In this example, the
323324progress bar uses the ``%message% `` and ``%filename% `` placeholders::
324325
326+ ProgressBar::setFormatDefinition('custom', ' %current%/%max% -- %message% (%filename%)');
327+
325328 $progressBar = new ProgressBar($output, 100);
326- $progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message% (%filename%)');
327329 $progressBar->setFormat('custom');
328330
329331The ``setMessage() `` method accepts a second optional argument to set the value
You can’t perform that action at this time.
0 commit comments