Exemple #1
0
 public static function getInstance()
 {
     if (!self::$intance) {
         self::$intance = new self();
     }
     return self::$intance;
 }
Exemple #2
0
 public static function app()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #3
0
 public static function init()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_viewer;
 }
Exemple #4
0
 /**
  * 页面通用数据
  */
 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];
 }
Exemple #5
0
 public static function setData($data)
 {
     self::$data = array_merge(self::$data, $data);
 }
Exemple #6
0
 /**
  * Add an array with headers to the view.
  *
  * @param array $headers
  */
 public function addHeaders(array $headers = array())
 {
     self::$headers = array_merge(self::$headers, $headers);
 }
Exemple #7
0
 /**
  * [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;
 }