https://github.com/joubertredrat/presenthor
The crazy presenter pattern library
https://github.com/joubertredrat/presenthor
crazy-things design-pattern design-patterns php php-lib php-library php7 presenter
Last synced: 10 months ago
JSON representation
The crazy presenter pattern library
- Host: GitHub
- URL: https://github.com/joubertredrat/presenthor
- Owner: joubertredrat
- License: mit
- Created: 2019-09-24T18:24:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T19:09:37.000Z (over 6 years ago)
- Last Synced: 2024-12-23T09:23:50.864Z (about 1 year ago)
- Topics: crazy-things, design-pattern, design-patterns, php, php-lib, php-library, php7, presenter
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Presenthor
[](https://travis-ci.org/joubertredrat/presenthor)
[](https://scrutinizer-ci.com/g/joubertredrat/presenthor/?branch=master)
[](https://scrutinizer-ci.com/g/joubertredrat/presenthor/?branch=master)
[](https://scrutinizer-ci.com/g/joubertredrat/presenthor/build-status/master)
[](https://packagist.org/packages/redrat/presenthor)
[](https://packagist.org/packages/redrat/presenthor)
[](https://packagist.org/packages/redrat/presenthor)
The crazy presenter pattern library
#### First question, why?
Because I'm a polemic person and I don't like serializes. Serialize is good? Yes, but for me, in many times is a big solution to solve a little problem.
#### Okay, how to install then?
Easy my friend, install from composer
```bash
composer require redrat/presenthor
```
#### How to use?
This library is separated in two parts, an `Item` and `Bag`.
All parts implements `OutputInterface`, then output `array` or json in string.
##### Item
An `Item` basically contains a data that will output `array` or `json` and you should to implement in your project based on `ItemInterface` or `ItemInjectableInterface`.
##### Bag
A `Bag` is a collection of `ItemInterface` and you can implement yours based on `ItemBagInterface` or use `ItemBag` implemented in this library.
#### Example
You can view an implementation example in https://github.com/joubertredrat/presenthor-example.