1 | <?php |
||
21 | final class BufferManager |
||
22 | { |
||
23 | /** |
||
24 | * @var BufferQueue |
||
25 | */ |
||
26 | private $executionQueue; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $renderingQueue; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | private $output; |
||
37 | |||
38 | 4 | public function __construct() |
|
43 | |||
44 | /** |
||
45 | * Add closure to buffer execution queue. |
||
46 | * |
||
47 | * @param callable $callable |
||
48 | * @param int $priority |
||
49 | */ |
||
50 | 4 | public function bufferize(callable $callable, $priority = 0) |
|
57 | |||
58 | /** |
||
59 | * Get output. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function render() |
|
67 | |||
68 | /** |
||
69 | * Display output. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | 4 | public function display() |
|
77 | |||
78 | /** |
||
79 | * Execute buffered templates and get output. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 4 | private function getOutput() |
|
103 | } |
||
104 |