symfony API

sfAnsiColorFormatter Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfAnsiColorFormatter provides methods to colorize text to be displayed on a console.

Inheritence

sfAnsiColorFormatter  <  sfFormatter

Method Summary

  • string excerpt($text, $size)
    Truncates a line.
  • string format($text, $parameters)
    Formats a text according to the given style or parameters.
  • formatSection($section, $text, $size, $style)
    Formats a message within a section.
  • setStyle($name, $options)
    Sets a new style.

Methods inherited from sfFormatter

excerpt , format , formatSection , setMaxLineSize , setStyle , __construct

Method Details

  • (string) excerpt ($text, $size)

    $text The text
    $size The maximum size of the returned string

    Truncates a line.

    returns The truncated string

  • (string) format ($text, $parameters)

    $text The test to style
    $parameters An array of options or a style name

    Formats a text according to the given style or parameters.

    returns The styled text

  • formatSection ($section, $text, $size, $style)

    $section The section name
    $text The text message
    $size The maximum size allowed for a line
    $style The color scheme to apply to the section string (INFO, ERROR, COMMENT or QUESTION)

    Formats a message within a section.

  • setStyle ($name, $options)

    $name The style name
    $options An array of options

    Sets a new style.