-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
53 lines (43 loc) · 815 Bytes
/
functions.php
File metadata and controls
53 lines (43 loc) · 815 Bytes
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
<?php
/**
* @param string $view
* @param array $params
*
* @return string
*/
function render($view, $params)
{
extract($params);
ob_start();
include __DIR__ . "/views/$view.php";
return ob_get_clean();
}
function report(Report $report)
{
return render('report', compact('report'));
}
function filter(Filter $filter)
{
return render('filter', compact('filter'));
}
function cssBlock(CssBlock $cssBlock)
{
return render('css-block', compact('cssBlock'));
}
function filters(array $filters)
{
return render('filters', compact('filters'));
}
function reportJson(Report $report)
{
return render('report-json', compact('report'));
}
/**
* @param $collection
*
* @return Collection
*/
function collection($collection = [])
{
return new Collection($collection);
}