symfony API

sfFormatter Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

sfFormatter provides methods to format 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 parameters.
  • formatSection($section, $text, $size)
    Formats a message within a section.
  • setMaxLineSize($size)
    Sets the maximum line size.
  • setStyle($name, $options)
    Sets a new style.
  • __construct()

Method Details

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

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

    Truncates a line.

    returns The truncated string

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

    $text The test to style
    $parameters An array of parameters

    Formats a text according to the given parameters.

    returns The formatted text

  • formatSection ($section, $text, $size) Browse code

    $section The section name
    $text The text message
    $size The maximum size allowed for a line

    Formats a message within a section.

  • setMaxLineSize ($size) Browse code

    $size The maximum line size for a message

    Sets the maximum line size.

  • setStyle ($name, $options) Browse code

    $name The style name
    $options An array of options

    Sets a new style.

  • __construct () Browse code