temirkhan / view
There is no license information available for the latest version (dev-master) of this package.
dev-master
2022-10-15 15:23 UTC
Requires
- php: ^7.3|^8.0
This package is auto-updated.
Last update: 2026-03-15 23:03:05 UTC
README
DEPRECATED
It seemd like a good idea but now I think it is much more relevant to use:
$result = SomeParticularView::create($data);
Reasons:
- It is more transparent(you can track what is used and where).
- It is more reliable(much more relevant to declare
PostView::create(Post $post): arraythanPostView::createView($context): mixed - In 90% of the cases we need stateless/dependency-free factories(no overhead with usage and even testing). So we can use static calls:
// this $data = PostView::createView($post); //instead of this $viewFactory = new PostView(); $data = $view->createView($post);
You can more detailed "example" here https://github.com/TemirkhanN/blog