Example #1
0
 /**
  * Add data to response output.
  * If JSON mode is on, array data will be attached to output-array
  * If JSON mode is off, data will be flatten, and attached as string to output
  *
  * @param mixed $data
  * @return void
  */
 public static function add($data)
 {
     if (self::$outJson and is_array($data)) {
         self::$data = self::$data + $data;
     } else {
         if (is_array($data)) {
             $data = implode('', array_values($data));
         }
         self::$data .= $data;
     }
 }