-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocator.hh
More file actions
74 lines (63 loc) · 1.61 KB
/
Locator.hh
File metadata and controls
74 lines (63 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?hh // strict
/**
* @copyright 2010-2015, The Titon Project
* @license http://opensource.org/licenses/bsd-license.php
* @link http://titon.io
*/
namespace Titon\View;
use Titon\View\Locator\PathList;
/**
* The Locator provides an interface for locating a defined template within a list of lookup paths.
*
* @package Titon\View
*/
interface Locator {
/**
* Add a lookup path.
*
* @param string $path
* @return $this
*/
public function addPath(string $path): this;
/**
* Add multiple lookup paths.
*
* @param \Titon\View\PathList $paths
* @return $this
*/
public function addPaths(PathList $paths): this;
/**
* Return the template file extension.
*
* @return string
*/
public function getExtension(): string;
/**
* Return all lookup paths.
*
* @return \Titon\View\PathList
*/
public function getPaths(): PathList;
/**
* Locate a template within the lookup paths and organize based on the type of template.
*
* @param string $template
* @param \Titon\View\Template $type
* @return string
*/
public function locate(string $template, Template $type = Template::OPEN): string;
/**
* Set the template file extension.
*
* @param string $ext
* @return $this
*/
public function setExtension(string $ext): this;
/**
* Set a list of lookup paths and overwrite any previously defined paths.
*
* @param \Titon\View\PathList $paths
* @return $this
*/
public function setPaths(PathList $paths): this;
}