1 | <?php |
||
14 | abstract class Stencil_Implementation implements Stencil_Interface, Stencil_Implementation_Interface { |
||
15 | /** |
||
16 | * The selected template engine |
||
17 | * |
||
18 | * @var $engine |
||
19 | */ |
||
20 | protected $engine; |
||
21 | |||
22 | /** |
||
23 | * Path to save caching files |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $cache_path; |
||
28 | |||
29 | /** |
||
30 | * Path to save compiled template files |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $compile_path; |
||
35 | |||
36 | /** |
||
37 | * Path to look for templates/views |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $template_path; |
||
42 | |||
43 | /** |
||
44 | * Template file extension to check is_file against |
||
45 | * This is needed to determine what template should be loaded |
||
46 | * according to the WordPress hierarchy |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $template_extension = 'tpl'; |
||
51 | |||
52 | /** |
||
53 | * Sets defaults like cache, compile and template directory paths. |
||
54 | * |
||
55 | * @throws Exception When cache path cannot be used. |
||
56 | */ |
||
57 | public function __construct() { |
||
96 | |||
97 | /** |
||
98 | * Called when the implementation is ready |
||
99 | */ |
||
100 | protected function ready() { |
||
103 | |||
104 | /** |
||
105 | * Fetch the engine so interaction is possible |
||
106 | * |
||
107 | * @return mixed |
||
108 | */ |
||
109 | public function get_engine() { |
||
112 | |||
113 | /** |
||
114 | * Get the template path |
||
115 | * |
||
116 | * @return string|array |
||
117 | */ |
||
118 | public function get_template_path() { |
||
121 | |||
122 | /** |
||
123 | * Get the file extension of the templates |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | public function get_template_extension() { |
||
130 | |||
131 | /** |
||
132 | * Displays a chosen template |
||
133 | * |
||
134 | * Uses fetch to fetch the output |
||
135 | * |
||
136 | * @param string $template Template file to use. |
||
137 | */ |
||
138 | public function display( $template ) { |
||
141 | } |
||
142 |