anlutro/l4-presenter

This package is abandoned and no longer maintained. No replacement package was suggested.

Presenter class for Laravel 4.

0.1.1 2014-03-12 19:18 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:52:26 UTC


README

Installation: composer require anlutro/l4-presenter

Pick the latest stable version from packagist or the GitHub tag list.

WARNING: Backwards compatibility is not guaranteed during version 0.x.

Presenter

Extend the \c\Presenter class and add methods that start with 'present' to replace the default getters on the underlying object. For example, presentFooBar will be invoked when you try to get $object->foo_bar. If no present method is found, the get is simply passed on to the underlying object.

Use MyPresenter::make($object) to make it work on Collection objects - this wraps every item in the collection in a presenter and returns the modified collection.

If your class implements \c\PresentableInterface, this method will be invoked and determine what's returned from \c\Presenter::make().

Contact

Open an issue on GitHub if you have any problems or suggestions.

License

The contents of this repository is released under the MIT license.