public static function getInstance() { if (!self::$intance) { self::$intance = new self(); } return self::$intance; }
public static function app() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
public static function init() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_viewer; }
/** * 页面通用数据 */ public static function data($key, $val = null) { if (is_array($key)) { self::$__data = $key; return; } if (!isset(self::$__data[$key])) { self::$__data[$key] = $val; } return self::$__data[$key]; }
public static function setData($data) { self::$data = array_merge(self::$data, $data); }
/** * Add an array with headers to the view. * * @param array $headers */ public function addHeaders(array $headers = array()) { self::$headers = array_merge(self::$headers, $headers); }
/** * [set Set Data form Views] * @param [string] $name [key] * @param [mixed] $value [value] */ public static function set($data) { self::$data = $data; //self::$data[$name] = $value; }