当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::getReturnedMessage方法代码示例

本文整理汇总了PHP中AppController::getReturnedMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::getReturnedMessage方法的具体用法?PHP AppController::getReturnedMessage怎么用?PHP AppController::getReturnedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppController的用法示例。


在下文中一共展示了AppController::getReturnedMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register

 public function register()
 {
     $message = "";
     $status = false;
     $code = '';
     $data = array();
     if ($this->request->is('post')) {
         $this->User->create();
         $data = array('username' => $this->data['username'], 'password' => $this->data['password'], 'role_id' => $this->data['role_id'], 'school_id' => $this->data['school_id'], 'level_id' => $this->data['level_id'], 'first_name' => $this->data['first_name'], 'father_name' => $this->data['father_name'], 'grandfather_name' => $this->data['grandfather_name'], 'family_name' => $this->data['family_name'], 'address' => $this->data['address'], 'phone_number' => $this->data['phone_number'], 'mobile_number' => $this->data['mobile_number'], 'email' => $this->data['email'], 'nationality_id' => $this->data['nationality_id']);
         if ($this->User->save($data)) {
             $status = true;
             $code = '203';
         } else {
             $code = '406';
         }
     }
     $this->response->type('json');
     $json_body = json_encode(array("message" => AppController::getReturnedMessage($code), "status" => $status, "code" => $code));
     $this->response->body($json_body);
 }
开发者ID:ClasseraQwaider,项目名称:ClassEraAPI,代码行数:20,代码来源:UsersController.php

示例2: subjectDetails

 public function subjectDetails($id)
 {
     $message = "";
     $status = false;
     $code = '';
     $json_subject = array();
     $this->render(false);
     if (!$id) {
         $code = '404';
     } else {
         $subject = $this->Subject->findById($id);
         if (!$subject) {
             $code = '404';
         } else {
             $json_subject = $subject['Subject'];
             $code = "200";
             $status = true;
         }
     }
     $this->response->type('json');
     $json_body = json_encode(array("comments" => $json_subject, "message" => AppController::getReturnedMessage($code), "status" => $status, "code" => $code));
     $this->response->body($json_body);
 }
开发者ID:ClasseraQwaider,项目名称:ClassEraAPI,代码行数:23,代码来源:SubjectsController.php

示例3: editComment

 public function editComment()
 {
     $message = "";
     $status = false;
     $code = '';
     $this->render(false);
     if ($this->request->is('get')) {
         throw new MethodNotAllowedException();
     }
     $id = $this->data['id'];
     $user_id = $this->data['user_id'];
     $data = array('id' => $this->data['id'], 'user_id' => $this->data['user_id'], 'subject_id' => $this->data['subject_id'], 'body' => $this->data['body']);
     if ($this->Comment->isOwendBy($id, $user_id)) {
         if ($this->Comment->save($data)) {
             $status = true;
             $code = '200';
         } else {
             $code = '409';
         }
     } else {
         $code = '408';
     }
     $this->response->type('json');
     $json_body = json_encode(array("message" => AppController::getReturnedMessage($code), "status" => $status, "code" => $code));
     $this->response->body($json_body);
 }
开发者ID:ClasseraQwaider,项目名称:ClassEraAPI,代码行数:26,代码来源:CommentsController.php


注:本文中的AppController::getReturnedMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。