示例#1
0
文件: jquery.php 项目: swk/bluebox
 /**
  * This function is used to populate the JSON response to
  * jquery.php.js
  *
  * @return void|string
  * @param bool $inline[optional] If false the json wrapped in a script tag is returned, otherwise it is echo'ed
  */
 public static function buildResponse($inline = true)
 {
     $script = '';
     if (!empty(jquery::$jquery)) {
         $script = javascript::codeBlock('    php.success(' . jquery::getResponse() . ', true);', array('inline' => $inline));
     }
     if ($inline) {
         echo $script;
     } else {
         return $script;
     }
 }