symfony API

sfFormatter Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

sfFormatter provides methods to format text to be displayed on a console.

Inheritence

sfAnsiColorFormatter  <  sfFormatter

Method Summary

  • string excerpt($text, $size = null)
    Truncates a line.
  • __construct($maxLineSize = 65)
  • setMaxLineSize($size)
    Sets the maximum line size.
  • string format($text = &apos;&apos;, $parameters = array(), (stream) $stream = STDOUT)
    Formats a text according to the given parameters.
  • formatSection($section, $text, $size = null)
    Formats a message within a section.

Method Details

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

    $text The text
    $size The maximum size of the returned string (65 by default)

    Truncates a line.

    returns The truncated string

  • __construct ($maxLineSize = 65)

  • setMaxLineSize ($size)

    $size The maximum line size for a message

    Sets the maximum line size.

  • (string) format ($text = &apos;&apos;, $parameters = array(), (stream) $stream = STDOUT)

    $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)

    $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.