1 | <?php |
||
27 | class Views |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * ViewBuilder Instance. |
||
32 | * |
||
33 | * @since 0.1.0 |
||
34 | * |
||
35 | * @var ViewBuilder |
||
36 | */ |
||
37 | protected static $viewBuilder; |
||
38 | |||
39 | /** |
||
40 | * Add a location to the ViewBuilder. |
||
41 | * |
||
42 | * @since 0.1.0 |
||
43 | * |
||
44 | * @param Location $location Location to add. |
||
45 | */ |
||
46 | 15 | public static function addLocation(Location $location) |
|
51 | |||
52 | /** |
||
53 | * Get the ViewBuilder instance. |
||
54 | * |
||
55 | * @since 0.1.0 |
||
56 | * |
||
57 | * @return ViewBuilder |
||
58 | */ |
||
59 | 15 | public static function getViewBuilder() |
|
67 | |||
68 | /** |
||
69 | * Instantiate the ViewBuilder. |
||
70 | * |
||
71 | * @since 0.1.0 |
||
72 | * |
||
73 | * @param ConfigInterface|null $config Optional. Configuration to pass into the ViewBuilder. |
||
74 | * |
||
75 | * @return ViewBuilder Instance of the ViewBuilder. |
||
76 | */ |
||
77 | 1 | public static function instantiateViewBuilder(ConfigInterface $config = null) |
|
81 | |||
82 | /** |
||
83 | * Create a new view for a given URI. |
||
84 | * |
||
85 | * @since 0.1.0 |
||
86 | * |
||
87 | * @param string $view View identifier to create a view for. |
||
88 | * @param string|null $type Type of view to create. |
||
89 | * |
||
90 | * @return View Instance of the requested view. |
||
91 | */ |
||
92 | 8 | public static function create($view, $type = null) |
|
98 | |||
99 | /** |
||
100 | * Render a view for a given URI. |
||
101 | * |
||
102 | * @since 0.1.0 |
||
103 | * |
||
104 | * @param string $view View identifier to create a view for. |
||
105 | * @param array $context Optional. The context in which to render the view. |
||
106 | * @param string|null $type Type of view to create. |
||
107 | * |
||
108 | * @return string Rendered HTML content. |
||
109 | */ |
||
110 | 7 | public static function render($view, array $context = [], $type = null) |
|
117 | } |
||
118 |