PHP Class Hooks, thinksns

Author: SamPeng ([email protected])
Show file Open project: medz/thinksns-4 Class Usage Examples

Protected Properties

Property Type Description
$htmlPath 插件路径
$mid
$model 登录用户ID
$path 模板变量
$tVar 插件数据模型对象

Public Methods

Method Description
__construct ( ) 初始化相关信息
display ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : string 显示指定HTML页面
fetch ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : string 渲染HTML页面
setPath ( string $path, boolean $html = false ) 设置该插件的路径,不能进行重写

Protected Methods

Method Description
assign ( string $name, string $value = '' ) 将数据渲染到HTML页面,设置模板变量的值
error ( string $message ) 错误提示方法
model ( string $name, string $class = 'Model' ) : object 获取插件目录下的Model模型文件
success ( string $message ) 成功提示方法

Private Methods

Method Description
_dispatch_jump ( string $message, integer $status = 1 ) 跳转操作

Method Details

__construct() public method

初始化相关信息
public __construct ( )

assign() protected method

将数据渲染到HTML页面,设置模板变量的值
protected assign ( string $name, string $value = '' )
$name string Key值
$value string Value值

display() public method

显示指定HTML页面
public display ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : string
$templateFile string 模板文件路径
$charset string 字符集,默认为UTF8
$contentType string 内容类型,默认为text/html
return string HTML页面数据

error() protected method

错误提示方法
protected error ( string $message )
$message string 提示信息

fetch() public method

渲染HTML页面
public fetch ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : string
$templateFile string 模板文件路径
$charset string 字符集,默认为UTF8
$contentType string 内容类型,默认为text/html
return string HTML页面数据

model() protected method

获取插件目录下的Model模型文件
protected model ( string $name, string $class = 'Model' ) : object
$name string Model名称
$class string 类名后缀,默认为Model
return object 返回一个模型对象

setPath() final public method

设置该插件的路径,不能进行重写
final public setPath ( string $path, boolean $html = false )
$path string 路径地址
$html boolean 是否为HTML路径,默认为false

success() protected method

成功提示方法
protected success ( string $message )
$message string 提示信息

Property Details

$htmlPath protected property

插件路径
protected $htmlPath

$mid protected property

protected $mid

$model protected property

登录用户ID
protected $model

$path protected property

模板变量
protected $path

$tVar protected property

插件数据模型对象
protected $tVar