PHP Class Atom

Mostrar archivo Open project: joyqi/logecho Class Usage Examples

Public Methods

Method Description
__construct ( string $charset = 'UTF-8' ) 创建Feed对象
addItem ( array $item ) : unknown $item的格式为 array ( 'title' => 'xxx', 'content' => 'xxx', 'excerpt' => 'xxx', 'date' => 'xxx', 'link' => 'xxx', 'author' => 'xxx', 'comments' => 'xxx', )
generate ( ) : string 输出字符串
setBaseUrl ( string $baseUrl ) : void 设置主页
setFeedUrl ( string $feedUrl ) : void 设置聚合地址
setSubTitle ( string $subTitle ) : void 设置副标题
setTitle ( string $title ) : void 设置标题

Private Methods

Method Description
encode ( mixed $str ) : string 去掉一些特殊字符

Method Details

__construct() public method

创建Feed对象
public __construct ( string $charset = 'UTF-8' )
$charset string

addItem() public method

$item的格式为 array ( 'title' => 'xxx', 'content' => 'xxx', 'excerpt' => 'xxx', 'date' => 'xxx', 'link' => 'xxx', 'author' => 'xxx', 'comments' => 'xxx', )
public addItem ( array $item ) : unknown
$item array
return unknown

generate() public method

输出字符串
public generate ( ) : string
return string

setBaseUrl() public method

设置主页
public setBaseUrl ( string $baseUrl ) : void
$baseUrl string 主页地址
return void

setFeedUrl() public method

设置聚合地址
public setFeedUrl ( string $feedUrl ) : void
$feedUrl string 聚合地址
return void

setSubTitle() public method

设置副标题
public setSubTitle ( string $subTitle ) : void
$subTitle string 副标题
return void

setTitle() public method

设置标题
public setTitle ( string $title ) : void
$title string 标题
return void