6
6
[ ![ Latest Stable Version] ( https://poser.pugx.org/league/fractal/v/stable.png )] ( https://packagist.org/packages/league/fractal )
7
7
8
8
Fractal provides a presentation and transformation layer for complex data output, the like found in
9
- RESTful APIs, and works really well with JSON.
9
+ RESTful APIs, and works really well with JSON. Think of this as a view layer for your JSON/YAML/etc.
10
10
11
11
When building an API it is common for people to just grab stuff from the database and pass it
12
- to ` json_encode() ` . This might be passable for "trivial" API's but if they are in use by the public,
13
- or used by an iPhone application then this will quickly lead to inconsistent output.
12
+ to ` json_encode() ` . This might be passable for "trivial" APIs but if they are in use by the public,
13
+ or used by mobile applications then this will quickly lead to inconsistent output.
14
14
15
15
## Goals
16
16
17
17
* Create a "barrier" between source data and output, so schema changes do not affect users
18
- * Systematic type-casting of data, to avoid foreach()ing through and (bool)ing everything
19
- * Embed (or nest) relationships for complex data structures
18
+ * Systematic type-casting of data, to avoid ` foreach() ` ing through and ` (bool) ` ing everything
19
+ * Include (a.k.a embedding, nesting or side-loading) relationships for complex data structures
20
+ * Work with standards like HAL and JSON-API but also allow custom serialization
20
21
* Support the pagination of data results, for small and large data sets alike
21
22
* Generally ease the subtle complexities of outputting data in a non-trivial API
22
23
23
- This package is compliant with [ PSR-1] [ ] , [ PSR-2] [ ] and [ PSR-4] [ ] . If you
24
- notice compliance oversights, please send a patch via pull request.
24
+ This package is compliant with [ PSR-1] , [ PSR-2] and [ PSR-4] . If you notice compliance oversights,
25
+ please send a patch via pull request.
25
26
26
27
[ PSR-1 ] : https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
27
28
[ PSR-2 ] : https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
@@ -48,9 +49,7 @@ The following versions of PHP are supported by this version.
48
49
* PHP 5.4
49
50
* PHP 5.5
50
51
* PHP 5.6
51
-
52
- HHVM support is also experimentally supported. It basically works, but CodeSniffer installation is screwing it up on
53
- Travis-CI.
52
+ * HHVM
54
53
55
54
## Documentation
56
55
@@ -61,7 +60,7 @@ Contribute to this documentation in the [sculpin branch](https://github.com/thep
61
60
## Todo
62
61
63
62
- Wrap optional params in a ParamBag object or similar
64
- - Complete JSON-API and HAL serializers
63
+ - Add JSON-API (kinda done) and HAL serializers
65
64
66
65
## Testing
67
66
@@ -76,6 +75,7 @@ Please see [CONTRIBUTING](https://github.com/thephpleague/fractal/blob/master/CO
76
75
77
76
## Credits
78
77
78
+ - [ Jason Lewis] ( https://github.com/jasonlewis )
79
79
- [ Phil Sturgeon] ( https://github.com/philsturgeon )
80
80
- [ All Contributors] ( https://github.com/thephpleague/fractal/contributors )
81
81
0 commit comments