1 | <?php |
||
19 | final class BufferManager |
||
20 | { |
||
21 | /** |
||
22 | * @var BufferQueue |
||
23 | */ |
||
24 | private $executionQueue; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $renderingQueue; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $output; |
||
35 | |||
36 | 2 | public function __construct() |
|
41 | |||
42 | /** |
||
43 | * Add closure to buffer execution queue. |
||
44 | * |
||
45 | * @param callable $callable |
||
46 | * @param int $priority |
||
47 | */ |
||
48 | 2 | public function bufferize(callable $callable, $priority = 0) |
|
55 | |||
56 | /** |
||
57 | * Get output. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function render() |
||
65 | |||
66 | /** |
||
67 | * Display output. |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | 2 | public function display() |
|
75 | |||
76 | /** |
||
77 | * Execute buffered templates and get output. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 2 | private function getOutput() |
|
101 | } |
||
102 |