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


PHP Api::json方法代码示例

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


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

示例1: delete

 public function delete($role)
 {
     if (in_array($role->name, \Role::$protected)) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     } else {
         return $role->delete() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
 }
开发者ID:Askedio,项目名称:LaravelCP-v1,代码行数:8,代码来源:RoleService.php

示例2: deleteIndex

 public function deleteIndex($user, $profile)
 {
     $id = $profile->id;
     if (!$profile->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $profile = UserProfiles::find($id);
     return empty($profile) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:9,代码来源:AdminProfileController.php

示例3: deleteIndex

 /**
  * Remove the specified resource from storage.
  *
  * @param $comment
  * @return Response
  */
 public function deleteIndex($comment)
 {
     $id = $comment->id;
     if (!$comment->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $comment = Comment::find($id);
     return empty($comment) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:15,代码来源:AdminCommentsController.php

示例4: delete

 public function delete($user)
 {
     return $user->delete() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:Laravel_Starter,代码行数:4,代码来源:UserService.php

示例5: delete

 public function delete($user, $profile)
 {
     return $this->user->deleteProfile($profile) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Askedio,项目名称:LaravelCP-v1,代码行数:4,代码来源:ProfileService.php

示例6: deleteIndex

 /**
  * Remove the specified user from storage.
  *
  * @param $user
  * @return Response
  */
 public function deleteIndex($user)
 {
     // Check if we are not trying to delete ourselves
     if ($user->id === Confide::user()->id) {
         // Redirect to the user management page
         return Api::to(array('error', Lang::get('admin/users/messages.delete.impossible'))) ?: Redirect::to('admin/users')->with('error', Lang::get('admin/users/messages.delete.impossible'));
     }
     $id = $user->id;
     Activity::log(array('contentID' => $user->id, 'contentType' => 'account_deleted', 'description' => $user->id, 'details' => '', 'updated' => Confide::user()->id ? true : false));
     Event::fire('controller.user.delete', array($user));
     if (!$user->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $user = User::find($id);
     return empty($user) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:22,代码来源:AdminUsersController.php

示例7: getStatus

 public function getStatus($tickets, $status)
 {
     $tickets->status = $status;
     return $tickets->save() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Askedio,项目名称:l4cp-support,代码行数:5,代码来源:SupportController.php

示例8: deleteIndex

 /**
  * Remove the specified resource from storage.
  *
  * @param $post
  * @return Response
  */
 public function deleteIndex($statuses)
 {
     $id = $statuses->id;
     if (!$statuses->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $statuses = TicketDeps::find($id);
     return empty($statuses) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Askedio,项目名称:l4cp-support,代码行数:15,代码来源:SupportStatusesController.php

示例9: assign

 public function assign($todo)
 {
     return $todo->assign() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:Laravel_Starter,代码行数:4,代码来源:TodoService.php

示例10: postAssign

 /**
  * assign to current user
  *
  * @return Response
  */
 public function postAssign($todo)
 {
     $todo->admin_id = Confide::user()->id;
     return $todo->save() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:10,代码来源:AdminTodosController.php

示例11: deleteIndex

 /**
  * Remove the specified user from storage.
  *
  * @param $map
  * @internal param $id
  * @return Response
  */
 public function deleteIndex($map)
 {
     $id = $map->id;
     if (!$map->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $maps = Map::find($id);
     return empty($maps) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:16,代码来源:AdminMapsController.php


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