PHP Class Action, thinksns

This library/program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------
Show file Open project: medz/thinksns-4 Class Usage Examples

Protected Properties

Property Type Description
$app
$appCssList
$appJsList
$initUserData
$langJsList
$mid
$site
$tVar
$templateFile
$trace
$uid
$user

Public Methods

Method Description
__call ( string $method, array $parms ) : mix 魔术方法 有不存在的操作的时候
__construct ( ) 架构函数 取得模板对
__set ( string $name, mix $value ) : mixed 魔术方法:注册模版变量
assign ( mixed $name, mixed $value = '' ) 模板变量赋
reinitUser ( $uid = '' ) 重设访问对象的用户信息 主要用于重写等地方
setDescription ( $description = '' ) 模板description
setKeywords ( $keywords = '' ) 模板keywords
setTitle ( $title = '' ) 模板Title

Protected Methods

Method Description
ajaxReturn ( mixed $data, String $info = '', boolean $status = 1, $type = 'JSON' ) Ajax方式返回数据到客户端
buildHtml ( string $content ) : boolen 输出静态化内容
display ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : voi 模板显示 调用内置的模板引擎显示方法
error ( string $message, boolean $ajax = false ) : voi 操作错误跳转的快捷方
fetch ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : strin 获取输出页面内容 调用内置的模板引擎fetch方法
get ( string $name ) : mixed 取得模板显示变量的值
isAjax ( ) : boolean 是否AJAX请求
page404 ( $message )
redirect ( string $url, array $params = [], integer $delay, string $msg = '' ) Action跳转(URL重定向) 支持指定模块和延时跳转
success ( string $message = '', boolean $ajax = false ) : voi 操作成功跳转的快捷方
trace ( mixed $name, mixed $value = '' ) Trace变量赋值

Private Methods

Method Description
_dispatch_jump ( string $message, boolean $status = 1, boolean $ajax = false ) 默认跳转操作 支持错误导向和正确跳转 调用模板显示 默认为public目录下面的success页面 提示页面为可配置 支持模板标签
initApp ( ) 应用信息初始化
initSite ( ) 站点信息初始化
initUser ( ) 用户信息初始化

Method Details

__call() public method

魔术方法 有不存在的操作的时候
public __call ( string $method, array $parms ) : mix
$method string 方法名
$parms array
return mix

__construct() public method

架构函数 取得模板对
public __construct ( )

__set() public method

魔术方法:注册模版变量
public __set ( string $name, mix $value ) : mixed
$name string 模版变量
$value mix 变量值
return mixed

ajaxReturn() protected method

Ajax方式返回数据到客户端
protected ajaxReturn ( mixed $data, String $info = '', boolean $status = 1, $type = 'JSON' )
$data mixed 要返回的数据
$info String 提示信息
$status boolean 返回状态

assign() public method

模板变量赋
public assign ( mixed $name, mixed $value = '' )
$name mixed 要显示的模板变量
$value mixed 变量的

buildHtml() protected method

输出静态化内容
protected buildHtml ( string $content ) : boolen
$content string 模板内容
return boolen

display() protected method

模板显示 调用内置的模板引擎显示方法
protected display ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : voi
$templateFile string 指定要调用的模板文件 默认为空 由系统自动定位模板文件
$charset string 输出编码
$contentType string 输出类
return voi

error() protected method

操作错误跳转的快捷方
protected error ( string $message, boolean $ajax = false ) : voi
$message string 错误信息
$ajax boolean 是否为Ajax方
return voi

fetch() protected method

获取输出页面内容 调用内置的模板引擎fetch方法
protected fetch ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : strin
$templateFile string 指定要调用的模板文件 默认为空 由系统自动定位模板文件
$charset string 输出编码
$contentType string 输出类
return strin

get() protected method

取得模板显示变量的值
protected get ( string $name ) : mixed
$name string 模板显示变量
return mixed

isAjax() protected method

是否AJAX请求
protected isAjax ( ) : boolean
return boolean

page404() protected method

protected page404 ( $message )

redirect() protected method

Action跳转(URL重定向) 支持指定模块和延时跳转
protected redirect ( string $url, array $params = [], integer $delay, string $msg = '' )
$url string 跳转的URL表达式
$params array 其它URL参数
$delay integer 延时跳转的时间 单位为秒
$msg string 跳转提示信息

reinitUser() public method

重设访问对象的用户信息 主要用于重写等地方
public reinitUser ( $uid = '' )

setDescription() public method

模板description
public setDescription ( $description = '' )

setKeywords() public method

模板keywords
public setKeywords ( $keywords = '' )

setTitle() public method

模板Title
public setTitle ( $title = '' )

success() protected method

操作成功跳转的快捷方
protected success ( string $message = '', boolean $ajax = false ) : voi
$message string 提示信息
$ajax boolean 是否为Ajax方
return voi

trace() protected method

Trace变量赋值
protected trace ( mixed $name, mixed $value = '' )
$name mixed 要显示的模板变量
$value mixed 变量的值

Property Details

$app protected property

protected $app

$appCssList protected property

protected $appCssList

$appJsList protected property

protected $appJsList

$initUserData protected property

protected $initUserData

$langJsList protected property

protected $langJsList

$mid protected property

protected $mid

$site protected property

protected $site

$tVar protected property

protected $tVar

$templateFile protected property

protected $templateFile

$trace protected property

protected $trace

$uid protected property

protected $uid

$user protected property

protected $user