Properties

$view

$view : \Think\view

视图实例对象

Type

\Think\view

$config

$config : \Think\config

控制器参数

Type

\Think\config

$_meta_title

$_meta_title : 

Type

$_tab_nav

$_tab_nav : 

Type

$_post_url

$_post_url : 

Type

$_form_items

$_form_items : 

Type

$_extra_items

$_extra_items : 

Type

$_form_data

$_form_data : 

Type

$_extra_html

$_extra_html : 

Type

$_ajax_submit

$_ajax_submit : 

Type

$_submit_title

$_submit_title : 

Type

$_template

$_template : 

Type

Methods

display()

display(  $template = '', string  $charset = '', string  $contentType = '', string  $content = '', string  $prefix = '') : void

显示页面

Parameters

$template
string $charset

输出编码

string $contentType

输出类型

string $content

输出内容

string $prefix

模板缓存前缀

__construct()

__construct() 

架构函数 取得模板对象实例

__set()

__set(  $name,   $value) 

Parameters

$name
$value

get()

get(string  $name = '') : mixed

取得模板显示变量的值

Parameters

string $name

模板显示变量

Returns

mixed

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(string  $name) : boolean

检测模板变量的值

Parameters

string $name

名称

Returns

boolean

__call()

__call(string  $method, array  $args) : mixed

魔术方法 有不存在的操作的时候执行

Parameters

string $method

方法名

array $args

参数

Returns

mixed

setMetaTitle()

setMetaTitle(  $meta_title) : $this

设置页面标题

Parameters

$meta_title

Returns

$this

setTabNav()

setTabNav(  $tab_list,   $current_tab) : $this

设置Tab按钮列表

Parameters

$tab_list

Tab列表 array('title' => '标题', 'href' => 'http://www.corethink.cn')

$current_tab

当前tab

Returns

$this

setExtraItems()

setExtraItems(  $extra_items) : $this

直接设置表单项数组

Parameters

$extra_items

Returns

$this

setPostUrl()

setPostUrl(  $post_url) : $this

设置表单提交地址

Parameters

$post_url

Returns

$this

addFormItem()

addFormItem(  $name,   $type,   $title,   $tip,   $options = array(),   $extra = '',   $extra_attr = '') : $this

加入一个表单项

Parameters

$name

表单名

$type

表单类型(取值参考系统配置FORM_ITEM_TYPE)

$title

表单标题

$tip

表单提示说明

$options

表单options

$extra

额外自定义项目

$extra_attr

表单项额外属性

Returns

$this

setFormData()

setFormData(  $form_data) : $this

设置表单表单数据

Parameters

$form_data

表单数据

Returns

$this

setExtraHtml()

setExtraHtml(  $extra_html) : $this

设置额外功能代码

Parameters

$extra_html

额外功能代码

Returns

$this

setAjaxSubmit()

setAjaxSubmit(  $ajax_submit = true) : $this

设置提交方式

Parameters

$ajax_submit

Returns

$this

setSubmitTitle()

setSubmitTitle(  $submit_title) : $this

确定按钮文本自定义

Parameters

$submit_title

确定按钮文本

Returns

$this

setTemplate()

setTemplate(  $template) : $this

设置页面模版

Parameters

$template

模版

Returns

$this

show()

show(string  $content, string  $charset = '', string  $contentType = '', string  $prefix = '') : mixed

输出内容文本可以包括Html 并支持内容解析

Parameters

string $content

输出内容

string $charset

模板输出字符集

string $contentType

输出类型

string $prefix

模板缓存前缀

Returns

mixed

fetch()

fetch(string  $templateFile = '', string  $content = '', string  $prefix = '') : string

获取输出页面内容 调用内置的模板引擎fetch方法,

Parameters

string $templateFile

指定要调用的模板文件 默认为空 由系统自动定位模板文件

string $content

模板输出内容

string $prefix

模板缓存前缀*

Returns

string

theme()

theme(string  $theme) : \Think\Action

模板主题设置

Parameters

string $theme

模版主题

Returns

\Think\Action

assign()

assign(mixed  $name, mixed  $value = '') : \Think\Action

模板变量赋值

Parameters

mixed $name

要显示的模板变量

mixed $value

变量的值

Returns

\Think\Action

error()

error(string  $message = '', string  $jumpUrl = '', mixed  $ajax = false) : void

操作错误跳转的快捷方法

Parameters

string $message

错误信息

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间

success()

success(string  $message = '', string  $jumpUrl = '', mixed  $ajax = false) : void

操作成功跳转的快捷方法

Parameters

string $message

提示信息

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间

ajaxReturn()

ajaxReturn(mixed  $data, String  $type = '', integer  $json_option) : void

Ajax方式返回数据到客户端

Parameters

mixed $data

要返回的数据

String $type

AJAX返回数据格式

integer $json_option

传递给json_encode的option参数

redirect()

redirect(string  $url, array  $params = array(), integer  $delay, string  $msg = '') : void

Action跳转(URL重定向) 支持指定模块和延时跳转

Parameters

string $url

跳转的URL表达式

array $params

其它URL参数

integer $delay

延时跳转的时间 单位为秒

string $msg

跳转提示信息

_initialize()

_initialize() : $this

初始化方法

Returns

$this

dispatchJump()

dispatchJump(string  $message, Boolean  $status = 1, string  $jumpUrl = '', mixed  $ajax = false) : void

默认跳转操作 支持错误导向和正确跳转 调用模板显示 默认为public目录下面的success页面 提示页面为可配置 支持模板标签

Parameters

string $message

提示信息

Boolean $status

状态

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间