Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcConsoleOutputFormats

ConsoleTools::ezcConsoleOutputFormats

Class ezcConsoleOutputFormats

Class to store the collection for formating classes.

This class stores objects of ezcConsoleOutputFormat, which represents a format option set for ezcConsoleOutput.

  1.  // New ezcConsoleOutput
  2.  // $output->format is instance of ezcConsoleOutputFormats.
  3.  $output = new ezcConsoleOutput();
  4.  
  5.  // Default format - color = blue
  6.  $output->formats->default->color = 'blue';
  7.  // Default format - weight = bold
  8.  $output->formats->default->style = array( 'bold' );
  9.  
  10.  // New format "important" - color = red
  11.  $output->formats->important->color = 'red';
  12.  // Format "important" - background color = black
  13.  $output->formats->important->bgcolor = 'black';

Source for this file: /ConsoleTools/src/structs/output_formats.php

Implements interfaces:

  • Iterator (internal interface)
  • Countable (internal interface)
Version:   //autogen//

Member Variables

protected array(ezcConsoleOutputFormat) $formats = array()
Array of ezcConsoleOutputFormat.

Method Summary

public ezcConsoleOutputFormats __construct( )
Create a new ezcConsoleOutputFormats object.
public void count( )
Returns the number of registered formats.
public ezcConsoleOutputFormat current( )
Returns the current Iterator value.
public string key( )
Returns the current Iterator key.
public ezcConsoleOutputFormat|bool next( )
Advances the Iterator to the next element.
public ezcConsoleOutputFormat rewind( )
Resets the Iterator to the first element.
public bool valid( )
Checks if the current Iterator position is still valid.
public ezcConsoleOutputFormat __get( $formatName )
Read access to the formats.
public bool __isset( $formatName )
Property isset access.
public void __set( $formatName , $val )
Write access to the formats.

Methods

__construct

ezcConsoleOutputFormats __construct( )

Create a new ezcConsoleOutputFormats object.

Creates a new, empty object of this class. It also adds a default format.

count

void count( )

Returns the number of registered formats.

Implementation of Countable::count().

Implementation of:
Method Description
Countable::count

current

Returns the current Iterator value.

Implementation of Iterator::current().

Implementation of:
Method Description
Iterator::current

key

string key( )

Returns the current Iterator key.

Implementation of Iterator::key().

Implementation of:
Method Description
Iterator::key

next

ezcConsoleOutputFormat|bool next( )

Advances the Iterator to the next element.

Implementation of Iterator::next().

Implementation of:
Method Description
Iterator::next

rewind

Resets the Iterator to the first element.

Implementation of Iterator::rewind().

Implementation of:
Method Description
Iterator::rewind

valid

bool valid( )

Checks if the current Iterator position is still valid.

Implementation of Iterator::valid().

Implementation of:
Method Description
Iterator::valid

__get

ezcConsoleOutputFormat __get( string $formatName )

Read access to the formats.

Formats are accessed directly like properties of this object. If a format does not exist, it is created on the fly (using default values),

Parameters:
Name Type Description
$formatName string

__isset

bool __isset( string $formatName )

Property isset access.

Parameters:
Name Type Description
$formatName string Name of the property.

__set

void __set( string $formatName , ezcConsoleOutputFormat $val )

Write access to the formats.

Formats are accessed directly like properties of this object. If a format does not exist, it is created on the fly (using default values),

Parameters:
Name Type Description
$formatName string
$val ezcConsoleOutputFormat The format defintion.
Documentation generated by phpDocumentor 1.4.3