PHP Class think\console\output\Formatter

Afficher le fichier Open project: top-think/framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) 初始化命令行输出格式
escape ( string $text ) : string 转义
format ( string $message ) : string 使用所给的样式格式化文字
getStyle ( string $name ) : Style 获取样式
getStyleStack ( ) : Stack
hasStyle ( string $name ) : boolean 是否有这个样式
isDecorated ( ) : boolean 获取外观标识
setDecorated ( boolean $decorated ) 设置外观标识
setStyle ( string $name, Style $style ) 添加一个新样式

Private Methods

Méthode Description
applyCurrentStyle ( string $text ) : string 从堆栈应用样式到文字
createStyleFromString ( string $string ) : Style | boolean 根据字符串创建新的样式实例

Method Details

__construct() public méthode

初始化命令行输出格式
public __construct ( )

escape() public static méthode

转义
public static escape ( string $text ) : string
$text string
Résultat string

format() public méthode

使用所给的样式格式化文字
public format ( string $message ) : string
$message string 文字
Résultat string

getStyle() public méthode

获取样式
public getStyle ( string $name ) : Style
$name string
Résultat think\console\output\formatter\Style

getStyleStack() public méthode

public getStyleStack ( ) : Stack
Résultat think\console\output\formatter\Stack

hasStyle() public méthode

是否有这个样式
public hasStyle ( string $name ) : boolean
$name string
Résultat boolean

isDecorated() public méthode

获取外观标识
public isDecorated ( ) : boolean
Résultat boolean

setDecorated() public méthode

设置外观标识
public setDecorated ( boolean $decorated )
$decorated boolean 是否美化文字

setStyle() public méthode

添加一个新样式
public setStyle ( string $name, Style $style )
$name string 样式名
$style think\console\output\formatter\Style 样式实例