选择语言 :

Core_View

视图核心类

API - Core_View

author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->__construct( )


$this->set_filename( $file )

设置视图文件名

 $view = new View();
 $view->set_filename('test_view');

参数列表

参数 类型 描述 默认值
$file string $file
返回值
  • View

View::factory( $file = null, $data = array ( ))

返回一个实例化好的视图对象

参数列表

参数 类型 描述 默认值
$file string $file null
$data array $data array(0)
返回值
  • View

$this->__set( )


$this->__get( )


$this->bind( $key , & $value )

设置一个内存地址变量

和直接set不同的是,设置地址引用的话,可以在修改变量时同时修改

参数列表

参数 类型 描述 默认值
$key string $key
$value mixed $value
返回值
  • View

$this->set( $key , $value = null)

设置变量

参数列表

参数 类型 描述 默认值
$key string $key
$value $value null
返回值
  • View

$this->render( $print = true)

执行视图输出

参数列表

参数 类型 描述 默认值
$print boolean 是否直接echo出,true: 是,false: 将执行完结果的HTML返回 bool true
返回值
  • string

$this->__toString( )


View::set_global( $key , $value = null)

设置全局视图变量

参数列表

参数 类型 描述 默认值
$key string/array $key
$value mixed $value null

View::get_global_data( )

返回全局视图数据

返回值
  • array

View::tag( $keystr )

输出tag支持

 View::tag('test');
 View::tag('test','arg1','arg2');

参数列表

参数 类型 描述 默认值
$keystr string $keystr

View::get_tag( $keystr )

获取指定key的Tag

参数列表

参数 类型 描述 默认值
$keystr string $keystr
返回值
  • array