Download the PHP package hvolschenk/cliphf without Composer
On this page you can find all versions of the php package hvolschenk/cliphf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hvolschenk/cliphf
More information about hvolschenk/cliphf
Files in hvolschenk/cliphf
Package cliphf
Short Description PHP Cli Formatting library.
License MIT
Homepage https://github.com/hvolschenk/cliphf
Informations about the package cliphf
CliPh-F
Very simple PHP CLI formatter.
Installation
Cliphf can either be cloned from the repository on Github or it can be installed via composer. The preferred way is through composer as you will then be able to receive updates easily.
Composer
Git
Usage
Output
You can format output for the command line with the Output::format
static method. It takes in only one argument and that is the string to be formatted. You can specify formats in an HTML-like syntax as in the following example:
Input
Capuring input is just as simple. You can specify normal text inputs and password inputs through CliPh-F with formatted labels:
Input text can also be formatted and uses the output class to format text:
Rules
There are 10 style rules for text and 8 colors built-in. The rules are:
- blink
- Creates blinking text
- bold
- Highlights the text by using a bold font
- dim
- Dims the text by making the color darker
- hide
- Creates hidden text (Same color as background, un-highlight-able)
- invert
- Inverts the backgroud and foreground colors
- italic
- Emphasises text by making it italic
- strikethrough
- Draws a line through the text
- underline
- Draws attention to the text by underlining it
- remove
- removes all formatting
- break
- Adds a linebreak
The 8 colors are:
- black
- blue
- cyan
- green
- magenta
- red
- white
- yellow