-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helper.hh
58 lines (49 loc) · 1.24 KB
/
Helper.hh
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
57
58
<?hh // strict
/**
* @copyright 2010-2015, The Titon Project
* @license http://opensource.org/licenses/bsd-license.php
* @link http://titon.io
*/
namespace Titon\View;
use Titon\Event\Event;
use Titon\Event\Listener;
/**
* Interface for the helpers library.
*
* @package Titon\View
*/
interface Helper extends Listener {
/**
* Return a helper that has been loaded into the view manager.
* If no view has been set, factory the helper from registry.
*
* @param string $name
* @return \Titon\View\Helper
*/
public function getHelper(string $name): Helper;
/**
* Return the view manager.
*
* @return \Titon\View\View
*/
public function getView(): ?View;
/**
* Triggered before a template (include layouts, wrappers, and partials) is rendered.
*
* @param \Titon\Event\Event $event
*/
public function preRender(Event $event): void;
/**
* Triggered after a template is rendered.
*
* @param \Titon\Event\Event $event
*/
public function postRender(Event $event): void;
/**
* Set the view manager.
*
* @param \Titon\View\View $view
* @return $this
*/
public function setView(View $view): this;
}