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


PHP Response::Json方法代码示例

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


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

示例1: isLoggedIn

 public function isLoggedIn(\Request $req, \Response $res)
 {
     if ($_SESSION['admin_id']) {
         $res->Json(array("flash" => "logged in"));
     } else {
         $res->Json(array("flash" => "not logged in"), "401");
     }
 }
开发者ID:beyondkeysystem,项目名称:mywebdesign,代码行数:8,代码来源:Login.php

示例2: getGrafico2

 public function getGrafico2()
 {
     if (Request::ajax()) {
         $resultados = Proyecto::getResultados2();
         return Response::Json($resultados);
     }
 }
开发者ID:soatadomicilio,项目名称:GestionProyecto,代码行数:7,代码来源:HomeController.php

示例3: createItem

 public function createItem(\Request $req, \Response $res)
 {
     $item = new \Model\Item();
     $item->customer_id = $req->customer_id;
     $item->name = $req->name;
     $item->product_id = $req->product_id;
     $item->next_bill_date = $req->next_bill_date;
     $item->write();
     $res->Json($item->toArray());
 }
开发者ID:beyondkeysystem,项目名称:mywebdesign,代码行数:10,代码来源:Item.php

示例4: getProducts

 public function getProducts(\Request $req, \Response $res)
 {
     $product = new \Model\Product();
     $products = $product->fetchAll();
     $result = array();
     foreach ($products as $product) {
         $result[] = $product->toArray();
     }
     $res->Json($result);
 }
开发者ID:beyondkeysystem,项目名称:mywebdesign,代码行数:10,代码来源:Product.php

示例5: getLinks

 public function getLinks(\Request $req, \Response $res)
 {
     $links = array(array("name" => "Admins", "url" => \Router::controllerUrl("Controller\\Admin::getAdmins")), array("name" => "Customers", "url" => \Router::controllerUrl("Controller\\Customer::getCustomers")), array("name" => "Products", "url" => \Router::controllerUrl("Controller\\Product::listProduct")));
     $res->Json($links);
 }
开发者ID:beyondkeysystem,项目名称:mywebdesign,代码行数:5,代码来源:AdminHome.php

示例6: getAll

 public function getAll()
 {
     $servicios = VistaServicioFuneral::select('id', 'nombre', 'precio_servicio', 'monto_comisionable', 'porcentaje_comision', DB::raw('CONCAT(nombre, " ","$", (round(precio_servicio * 1.16))) AS nombre_display'))->get();
     return Response::Json($servicios);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:ServicioFuneralControlador.php

示例7: getAll

 public function getAll()
 {
     $cliente = VistaClientes::select('id', DB::raw("CONCAT(nombres, ' ', apellido_paterno, ' ', apellido_materno) as nombre"))->get();
     return Response::Json($cliente);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:ClienteControlador.php

示例8: getAll

 public function getAll()
 {
     $asesor = Asesor::select('asesor.id as id_asesor', DB::raw("CONCAT(persona.nombres, ' ', persona.apellido_paterno, ' ', persona.apellido_materno) as Asesor"))->leftjoin('persona', 'asesor.persona_id', '=', 'persona.id')->get();
     return Response::Json($asesor);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:AsesorControlador.php

示例9: getAll

 public function getAll()
 {
     $productos_recubrimientos = VistaRecubrimiento::select('id', 'nombre', 'precio_recubrimiento', 'porcentaje_comision', DB::raw('CONCAT(nombre, " ","$", (round(precio_recubrimiento * 1.16))) AS nombre_display'))->get();
     return Response::Json($productos_recubrimientos);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:RecubrimientoControlador.php

示例10: getAll

 public function getAll()
 {
     $comisiones = VistaComision::all();
     return Response::Json($comisiones);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:ComisionControlador.php

示例11: dreply

 public function dreply()
 {
     if (!Sentry::check()) {
         return Response::json(array('errCode' => 10, 'message' => '请登录'));
     }
     $user = Sentry::getUser();
     $reply_id = Input::get('reply_id');
     $reply = ArticleJoinCom::find($reply_id);
     if (!isset($reply)) {
         return Response::Json(array('errCode' => 2, 'message' => '[reply_id对应的回复不存在]此回复不存在!'));
     }
     if ($reply->sender_id != $user->id) {
         return Response::Json(array('errCode' => 3, 'message' => '[权限不够]不可删除别人的回复!'));
     }
     if (!$reply->delete()) {
         return Response::json(array('errCode' => 4, 'message' => '[数据库错误]删除失败'));
     }
     return Response::json(array('errCode' => 0, 'message' => '删除成功'));
 }
开发者ID:Jv-Juven,项目名称:gift,代码行数:19,代码来源:ArticleController.php

示例12: deleteAdmin

 public function deleteAdmin(\Request $req, \Response $res)
 {
     $admin = new \Model\Admin($req->param("id"));
     $admin->deleteFromDb();
     $res->Json(array("message" => "Admin successfully deleted"));
 }
开发者ID:beyondkeysystem,项目名称:mywebdesign,代码行数:6,代码来源:Admin.php

示例13: getAll

 public function getAll()
 {
     $extras = VistaExtra::select('id', 'nombre', 'precio_extra', 'porcentaje_comision', DB::raw('CONCAT(nombre, " ","$", (round(precio_extra * 1.16))) AS nombre_display'))->get();
     return Response::Json($extras);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:ExtraControlador.php

示例14: postNestable

 function postNestable()
 {
     $listMenus = Input::get('menu');
     $order = 0;
     if (!empty($listMenus)) {
         foreach ($listMenus as $id => $parent) {
             $order++;
             $menu = Menus::where('id', $id)->update(array('parent_id' => intval($parent), 'order' => $order));
         }
     }
     return Response::Json(TRUE);
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:12,代码来源:ModulesAdminController.php

示例15: getAll

 public function getAll()
 {
     $construcciones = VistaProductoConstruccion::select('id', 'nombre', 'precio_construccion', 'porcentaje_comision', DB::raw('CONCAT(nombre, " ","$", (round(precio_construccion * 1.16))) AS nombre_display'))->get();
     return Response::Json($construcciones);
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:5,代码来源:ConstruccionControlador.php


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