/
Renderer.php
56 lines (51 loc) · 1.54 KB
/
Renderer.php
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
<?php
namespace mindplay\kisstpl;
/**
* @see ViewService
*/
interface Renderer
{
/**
* Locate and render a PHP template for the given view, directly to output - as
* opposed to {@see capture()} which will use output buffering to capture the
* content and return it as a string.
*
* The view will be made available to the template as <code>$view</code> and the
* calling context (<code>$this</code>) will be this ViewService.
*
* @param object $view the view-model to render
* @param string|null $type the type of view to render (optional)
*
* @return void
*
* @see capture()
*/
public function render($view, $type = null);
/**
* Render and capture the output from a PHP template for the given view - as
* opposed to {@see render()} which will render directly to output.
*
* Use capture only when necessary, such as when capturing content from a
* rendered template to populate the body of an e-mail.
*
* @param object $view the view-model to render
* @param string|null $type the type of view to render (optional)
*
* @return string rendered content
*
* @see render()
*/
public function capture($view, $type = null);
/**
* @param string &$var target variable reference for captured content
*
* @see end()
*/
public function begin(&$var);
/**
* @param string &$var target variable reference for captured content
*
* @see begin()
*/
public function end(&$var);
}