Beispiel #1
0
 /**
  * 自动载入
  *
  * @param unknown $class            
  */
 public static function autoload($class)
 {
     $classpath = str_replace("\\", "/", APP_PATH . $class . ".class.php");
     if (file_exists($classpath)) {
         require_once $classpath;
     } else {
         $message = $classpath . " not exists ";
         RestPHP::error($message);
     }
 }
Beispiel #2
0
 /**
  * 删除数据
  * 
  * @return boolean
  */
 protected function delete()
 {
     if (!$this->_where) {
         RestPHP::error("更新条件不能空");
     }
     $sql = "DELETE FROM {$this->_table}  WHERE " . $this->_where . ";";
     $sth = $this->db->prepare($sql);
     $rs = $sth->execute();
     return $rs;
 }
 /**
  * 输出json格式
  *
  * @param array $data
  *            内容
  * @param bool $status
  *            状态
  * @param string $message
  *            提示信息
  */
 public function json($data, $status, $message)
 {
     return RestPHP::json($data, $status, $message);
 }