gonzalo123/angularpostrequestserviceprovider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gonzalo123/angularpostrequestserviceprovider

Composer 安装命令:

composer require gonzalo123/angularpostrequestserviceprovider

包简介

Angular POST Request Service Provider

README 文档

README

Build Status

When we work with AngularJs Applications POST request uses Content-Type: application/json Silex (and Symfony) assumes application/x-www-form-urlencoded Here we can se how to handle those requests with Silex: https://github.com/qandidate-labs/symfony-json-request-transformer

In this small project we are going to enclose this funcionality within a ServiceProvider

Install Via Composer

{
    "require": {
        "gonzalo123/angularpostrequestserviceprovider": "~1.0"
    }
}

Usage

use Silex\Application;
use G\AngularPostRequestServiceProvider;
use Symfony\Component\HttpFoundation\Request;

$app = new Application();
$app->register(new AngularPostRequestServiceProvider());

$app->post("/post", function (Application $app, Request $request) {
    return $app->json([
        'status' => true,
        'name'   => $request->get('name')
    ]);
});

$app->run();

统计信息

  • 总下载量: 101
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-20