for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Plates\Extension\Data;
use League\Plates;
final class DataHydrateTemplate implements Plates\HydrateTemplate
{
private $resolve_data;
public function __construct(callable $resolve_data) {
$this->resolve_data = $resolve_data;
}
public function hydrateTemplate(Plates\Template $template) {
$template->data = ($this->resolve_data)(ResolveDataArgs::fromTemplate($template));