1 | <?php |
||
8 | class TemplateService |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var array The templates paths |
||
13 | */ |
||
14 | protected $templatesPathStack = array(); |
||
15 | |||
16 | /** |
||
17 | * Retrieve paths to templates |
||
18 | * |
||
19 | * @return array |
||
20 | */ |
||
21 | 7 | public function getTemplatesPathStack() |
|
25 | |||
26 | /** |
||
27 | * Set the templates paths |
||
28 | * |
||
29 | * @param array $templatesPathStack |
||
30 | */ |
||
31 | 16 | public function setTemplatesPathStack(Array $templatesPathStack) |
|
35 | |||
36 | 15 | public function __construct(Array $templatesPathStack) |
|
40 | |||
41 | /** |
||
42 | * Return the FIRST paths that contain a template with the specified name |
||
43 | * (There should not be more than one posible template path) |
||
44 | * |
||
45 | * @param string $templateName |
||
46 | * @return string |
||
47 | */ |
||
48 | 6 | public function getExistantTemplatePath($templateName) |
|
59 | |||
60 | /** |
||
61 | * Returns true if it is a valid template |
||
62 | * |
||
63 | * @param string $templatePath |
||
64 | * @return boolean |
||
65 | */ |
||
66 | 9 | public function validTemplate($templatePath) |
|
75 | |||
76 | /** |
||
77 | * Creats a Template instance from an array with page Data. |
||
78 | * |
||
79 | * @param array $data |
||
80 | * @throws TemplateNameNotSetException |
||
81 | * @return Template |
||
82 | */ |
||
83 | 8 | public function createFromData(Array $data) |
|
100 | } |
||
101 |