本文整理汇总了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");
}
}
示例2: getGrafico2
public function getGrafico2()
{
if (Request::ajax()) {
$resultados = Proyecto::getResultados2();
return Response::Json($resultados);
}
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例7: getAll
public function getAll()
{
$cliente = VistaClientes::select('id', DB::raw("CONCAT(nombres, ' ', apellido_paterno, ' ', apellido_materno) as nombre"))->get();
return Response::Json($cliente);
}
示例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);
}
示例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);
}
示例10: getAll
public function getAll()
{
$comisiones = VistaComision::all();
return Response::Json($comisiones);
}
示例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' => '删除成功'));
}
示例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"));
}
示例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);
}
示例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);
}
示例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);
}