Class Pel

Description

Class with miscellaneous static methods.

This class will contain various methods that govern the overall behavior of PEL.

Located in /Pel.php (line 58)


	
			
Variable Summary
 boolean $debug
Method Summary
 void debug (string $format, mixed $args,...)
 string fmt (string $format, mixed $args,...)
 string tra (string $str)
 void warning (string $format, mixed $args,...)
Variables
boolean $debug = false (line 69)

Flag for controlling debug information.

The methods producing debug information (debug() and warning()) will only output something if this variable is set to true.

  • static:
Methods
debug (line 84)

Conditionally output debug information.

This method works just like printf() except that it always terminates the output with a newline, and that it only outputs something if the PEL_DEBUG defined to some true value.

  • static:
void debug (string $format, mixed $args,...)
  • string $format: the format string.
  • mixed $args,...: any number of arguments can be given. The arguments will be available for the format string as usual with sprintf().
fmt (line 154)

Translate and format a string.

This static function will first use Gettext to translate a format string, which will then have access to any extra arguments. By always using this function for dynamic string one is assured that the translation will be taken from the correct text domain. If the string is static, use tra instead as it will be faster.

  • return: the translated string, or the original string if no translation could be found.
  • static:
string fmt (string $format, mixed $args,...)
  • string $format: the format string. This will be translated before being used as a format string.
  • mixed $args,...: any number of arguments can be given. The arguments will be available for the format string as usual with sprintf().
tra (line 129)

Translate a string.

This static function will use Gettext to translate a string. By always using this function for static string one is assured that the translation will be taken from the correct text domain. Dynamic strings should be passed to fmt instead.

  • return: the translated string, or the original string if no translation could be found.
  • static:
string tra (string $str)
  • string $str: the string that should be translated.
warning (line 107)

Conditionally output a warning.

This method works just like printf() except that it prepends the output with the string 'Warning: ', terminates the output with a newline, and that it only outputs something if the PEL_DEBUG defined to some true value.

  • static:
void warning (string $format, mixed $args,...)
  • string $format: the format string.
  • mixed $args,...: any number of arguments can be given. The arguments will be available for the format string as usual with sprintf().

SourceForge.net Logo Documentation generated on Wed, 21 Jul 2004 19:12:54 +0200 by phpDocumentor 1.3.0RC3