Exemplo n.º 1
0
 protected function handle()
 {
     if ($this->request->isAjax()) {
         return JsonResponse::notFound();
     }
     return Response::notFound();
 }
Exemplo n.º 2
0
 public function get()
 {
     try {
         return JsonResponse::ok(array('color' => $this->getColor(), 'days' => $this->getDays(), 'temp' => intval(round($this->getTemp())), 'time' => time(), 'offset' => date('Z')));
     } catch (Exception $e) {
         return JsonResponse::error(array('error' => $e->getMessage()));
     }
 }
Exemplo n.º 3
0
 public function post()
 {
     try {
         $temp = strtolower(trim($this->request->getPost('data')));
         $this->setTemp($temp);
         return JsonResponse::ok(array('temp' => $this->getTemp()));
     } catch (Exception $e) {
         return JsonResponse::error(array('error' => $e->getMessage()));
     }
 }
Exemplo n.º 4
0
 public function delete()
 {
     return $this->request->isAjax() ? JsonResponse::methodNotAllowed() : Response::methodNotAllowed();
 }