deeplace / adminarchitect-presentable
There is no license information available for the latest version (v1.0.0) of this package.
Simple Object Presenter
Package info
github.com/Deeplace/adminarchitect-presentable
pkg:composer/deeplace/adminarchitect-presentable
v1.0.0
2026-03-30 07:01 UTC
Requires
- php: >=5.6.0
This package is not auto-updated.
Last update: 2026-03-30 11:47:24 UTC
README
Move presentation logic out from the Object class.
Installation
composer require terranet/presentable
Use Case
<?php
class Post implements PresentableInterfacee
{
use PresentableTrait;
protected $presenter = PostPresenter::class;
}
<?php
class PostPresenter extends Presenter
{
public function title()
{
return '<a href="/posts/read/' . $this->presentable->url . '">' . $this->presentable->title . '</a>';
}
}
In view, instead of calling $post->title, call Presenter's method $post->present()->title;