當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。