walnut / lib_viewrenderer
There is no license information available for the latest version (dev-main) of this package.
dev-main
2024-09-15 21:33 UTC
Requires
- walnut/lib_httpmapper: ^0.0.7
- walnut/lib_templaterenderer: dev-master
Requires (Dev)
- phpunit/phpunit: ^9.5.20
- vimeo/psalm: ^4.23.0
This package is not auto-updated.
Last update: 2024-10-28 20:19:27 UTC
README
This is a very basic view renderer that maps any PHP class (view) to a template file.
Examples
The usage is straightforward
//Setup (usually done via DI) $renderer = new PhpTemplateRenderer( new PerFileTemplateNameMapper('templates', 'php') ); $viewMapper = new LookupViewMapper([ HomePageView::class => 'home-page', AboutPageView::class => 'about-page' ]) $adapter = new ViewRendererAdapter($renderer, $viewMapper); //Usage $view = new HomePageView; $adapter->render($view);