1: <?php
2:
3: namespace Charcoal\App\Template;
4:
5: // PSR-7 (HTTP Messaging) dependencies
6: use \Psr\Http\Message\RequestInterface;
7:
8: // Dependencies from `Pimple`
9: use \Pimple\Container;
10:
11: /**
12: *
13: */
14: interface TemplateInterface
15: {
16:
17: /**
18: * Give an opportunity to children classes to inject dependencies from a Pimple Container.
19: *
20: * Does nothing by default, reimplement in children classes.
21: *
22: * The `$container` DI-container (from `Pimple`) should not be saved or passed around, only to be used to
23: * inject dependencies (typically via setters).
24: *
25: * @param Container $container A dependencies container instance.
26: * @return void
27: */
28: public function setDependencies(Container $container);
29:
30: /**
31: * @param array $data The template data to set.
32: * @return TemplateInterface Chainable
33: */
34: public function setData(array $data);
35:
36: /**
37: * Initialize the template with a request.
38: *
39: * @param RequestInterface $request The request to intialize.
40: * @return boolean
41: */
42: public function init(RequestInterface $request);
43: }
44: