1 | <?php |
||
9 | class Templater { |
||
10 | |||
11 | protected $templates = array(); |
||
12 | |||
13 | /** |
||
14 | * Hook all templates to the administration footer. |
||
15 | */ |
||
16 | public function boot() { |
||
19 | |||
20 | /** |
||
21 | * Register a new template. |
||
22 | * |
||
23 | * @param string $name Template name |
||
24 | * @param string $html Template content |
||
25 | */ |
||
26 | 5 | public function add_template( $name, $html ) { |
|
35 | |||
36 | /** |
||
37 | * Get a template by name. |
||
38 | * |
||
39 | * @param string $name Template name |
||
40 | * @return string |
||
41 | */ |
||
42 | 3 | public function get_template( $name ) { |
|
48 | |||
49 | /** |
||
50 | * Get all registered templaes. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | 2 | public function get_templates() { |
|
57 | |||
58 | /** |
||
59 | * Render all registered templates. |
||
60 | */ |
||
61 | 1 | public function render_templates() { |
|
77 | } |
||
78 |