embergrep/fractal-ember
最新稳定版本:0.1.0
Composer 安装命令:
composer require embergrep/fractal-ember
包简介
A set of serializers for building Ember ready APIs using Fractal
README 文档
README
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Install
Via Composer
$ composer require embergrep/fractal-ember
Usage
use Acme\Model\Book; use Acme\Transformer\BookTransformer; use League\Fractal\Manager; use League\Fractal\Resource\Item; use Embergrep\Serializers\EmberSerializer; $manager = new Manager(); $manager->setSerializer(new EmberSerializer()); // Some sort of ORM call $book = Book::find(1); // Make a resource out of the data and $resource = new Item($book, new BookTransformer(), 'book'); // Run all transformers $manager->createData($resource)->toArray(); // Outputs: // [ // 'book' => [ // 'id' => 'Foo', // 'title' => 'Foo', // 'year' => 1991, // ], // 'authors' => [ // [ // 'id' => 'Baz', // 'name' => 'Walter', // ], // ];
Testing
$ phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 278
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-19