-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathView.php
51 lines (46 loc) · 1.28 KB
/
View.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
<?php
namespace Darya\View;
/**
* Darya's interface for views.
*
* @author Chris Andrew <[email protected]>
*/
interface View
{
/**
* Select a template and optionally assign arguments and configuration variables.
*
* @param string $file The template file to be used
* @param array $arguments [optional] Arguments to assign to the template
* @param array $config [optional] Configuration variables for the view
*/
public function select($file, array $arguments = [], array $config = []);
/**
* Get and optionally set view configuration variables.
*
* This merges given variables with any that have been previously set.
*
* @param array $config [optional]
* @return array
*/
public function config(array $config = []);
/**
* Assign an array of arguments to the template.
*
* @param array $arguments Arguments to assign to the template
*/
public function assign(array $arguments);
/**
* Get all arguments or a specific argument assigned to the template.
*
* @param string $key [optional] The key of the argument to return
* @return mixed The value of the $key argument if set, all arguments otherwise
*/
public function assigned($key = null);
/**
* Render the view.
*
* @return string The rendered view
*/
public function render();
}