sfFormatter provides methods to format text to be displayed on a console.
Method Summary
-
string
excerpt($text, $size = null)
Truncates a line.
-
string
format($text = '', $parameters = array(), (stream) $stream = STDOUT)
Formats a text according to the given parameters.
-
formatSection($section, $text, $size = null)
Formats a message within a section.
-
setMaxLineSize($size)
Sets the maximum line size.
-
__construct($maxLineSize = 65)
Method Details
-
(string) excerpt ($text, $size = null)
Browse code
| $text |
The text
|
| $size |
The maximum size of the returned string (65 by default)
|
Truncates a line.
returns The truncated string
-
(string) format ($text = '', $parameters = array(), (stream) $stream = STDOUT)
Browse code
| $text |
The test to style
|
| $parameters |
An array of parameters
|
| $stream |
A stream (default to STDOUT)
|
Formats a text according to the given parameters.
returns The formatted text
-
formatSection ($section, $text, $size = null)
Browse code
| $section |
The section name
|
| $text |
The text message
|
| $size |
The maximum size allowed for a line (65 by default)
|
Formats a message within a section.
-
setMaxLineSize ($size)
Browse code
| $size |
The maximum line size for a message
|
Sets the maximum line size.
-
__construct ($maxLineSize = 65)
Browse code
|