PHP Класс Hooks, thinksns

Автор: SamPeng ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$htmlPath 插件路径
$mid
$model 登录用户ID
$path 模板变量
$tVar 插件数据模型对象

Открытые методы

Метод Описание
__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 ) 设置该插件的路径,不能进行重写

Защищенные методы

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

Приватные методы

Метод Описание
_dispatch_jump ( string $message, integer $status = 1 ) 跳转操作

Описание методов

__construct() публичный Метод

初始化相关信息
public __construct ( )

assign() защищенный Метод

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

display() публичный Метод

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

error() защищенный Метод

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

fetch() публичный Метод

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

model() защищенный Метод

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

setPath() закрытый публичный Метод

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

success() защищенный Метод

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

Описание свойств

$htmlPath защищенное свойство

插件路径
protected $htmlPath

$mid защищенное свойство

protected $mid

$model защищенное свойство

登录用户ID
protected $model

$path защищенное свойство

模板变量
protected $path

$tVar защищенное свойство

插件数据模型对象
protected $tVar