\Outputter
A simple class for rendering output to the console
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class Outputter
{
- // members
- protected $progressValue = NULL;
- // methods
- public static string format()
- public void writeln()
- public void write()
- public boolean ask()
- public string prompt()
- public void updateProgress()
- public void updateProgressPercent()
- public InPlaceOutput clearProgress()
Members
protected
- $progressValue
—
string
The current value of the progress output
Methods
public
- ask() — Asks the user a question. If a 'y' value is entered, returns true
- clearProgress() — Resets the output
- format() — Formats simple html-like markup into coloured text Supports: - <b>bold text</b> - <success>Green text</success> - <error>Red text</error> - <caution>Yellow text</caution> - <info>Cyan text</info>
- prompt() — Prompts the user for input
- updateProgress() — Updates the output with new text
- updateProgressPercent() — A helper method for updating the value when it is a percentage
- write() — Writes text to the output stream
- writeln() — Writes text to the output stream, followed by a new line