1 | <?php |
||
11 | class Name |
||
12 | { |
||
13 | /** |
||
14 | * Instance of the template engine. |
||
15 | * @var Engine |
||
16 | */ |
||
17 | protected $engine; |
||
18 | |||
19 | /** |
||
20 | * The original name. |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $name; |
||
24 | |||
25 | /** |
||
26 | * The parsed template folder. |
||
27 | * @var Folder |
||
28 | */ |
||
29 | protected $folder; |
||
30 | |||
31 | /** |
||
32 | * The parsed template filename. |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $file; |
||
36 | |||
37 | /** |
||
38 | * Create a new Name instance. |
||
39 | * @param Engine $engine |
||
40 | * @param string $name |
||
41 | */ |
||
42 | 100 | public function __construct(Engine $engine, $name) |
|
47 | |||
48 | /** |
||
49 | * Set the engine. |
||
50 | * @param Engine $engine |
||
51 | * @return Name |
||
52 | */ |
||
53 | 100 | public function setEngine(Engine $engine) |
|
59 | |||
60 | /** |
||
61 | * Get the engine. |
||
62 | * @return Engine |
||
63 | */ |
||
64 | 2 | public function getEngine() |
|
68 | |||
69 | /** |
||
70 | * Set the original name and parse it. |
||
71 | * @param string $name |
||
72 | * @return Name |
||
73 | */ |
||
74 | 100 | public function setName($name) |
|
94 | |||
95 | /** |
||
96 | * Get the original name. |
||
97 | * @return string |
||
98 | */ |
||
99 | 10 | public function getName() |
|
103 | |||
104 | /** |
||
105 | * Set the parsed template folder. |
||
106 | * @param string $folder |
||
107 | * @return Name |
||
108 | */ |
||
109 | 10 | public function setFolder($folder) |
|
115 | |||
116 | /** |
||
117 | * Get the parsed template folder. |
||
118 | * @return string |
||
119 | */ |
||
120 | 8 | public function getFolder() |
|
124 | |||
125 | /** |
||
126 | * Set the parsed template file. |
||
127 | * @param string $file |
||
128 | * @return Name |
||
129 | */ |
||
130 | 98 | public function setFile($file) |
|
147 | |||
148 | /** |
||
149 | * Get the parsed template file. |
||
150 | * @return string |
||
151 | */ |
||
152 | 8 | public function getFile() |
|
156 | |||
157 | /** |
||
158 | * Resolve template path. |
||
159 | * @return string |
||
160 | */ |
||
161 | 72 | public function getPath() |
|
175 | |||
176 | /** |
||
177 | * Check if template path exists. |
||
178 | * @return boolean |
||
179 | */ |
||
180 | 60 | public function doesPathExist() |
|
184 | |||
185 | /** |
||
186 | * Get the default templates directory. |
||
187 | * @return string |
||
188 | */ |
||
189 | 70 | protected function getDefaultDirectory() |
|
202 | } |
||
203 |