1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\TwigTemplating;
12:
13: /**
14: * Class representation of a template.
15: */
16: class Template
17: {
18: /**
19: * The name of the template - usually its file path.
20: *
21: * @var string
22: */
23: protected $name;
24:
25: /**
26: * The context of the template.
27: *
28: * @var TemplateContext
29: */
30: protected $context;
31:
32: /**
33: * @param string $name
34: * @param array $context
35: */
36: public function __construct($name, array $context = array())
37: {
38: $this->name = $name;
39: $this->context = new TemplateContext($context);
40: }
41:
42: /**
43: * Get the name of the template.
44: *
45: * @return string
46: */
47: public function getName()
48: {
49: return $this->name;
50: }
51:
52: /**
53: * Get the template's context.
54: *
55: * @return TemplateContext
56: */
57: public function getContext()
58: {
59: return $this->context;
60: }
61: }
62: