-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathYii2DebugViewRenderer.php
56 lines (52 loc) · 1.04 KB
/
Yii2DebugViewRenderer.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
52
53
54
55
56
<?php
/**
* Yi2iDebugViewRenderer
*
* @author Roman Zhuravlev <[email protected]>
* @package Yii2Debug
* @since 1.1.13
*/
class Yii2DebugViewRenderer extends CViewRenderer
{
/**
* @var CViewRenderer
*/
public $instance;
/**
* @var array
*/
private $_stack = array();
public function getStack()
{
return $this->_stack;
}
/**
* @param CBaseController $context
* @param string $sourceFile
* @param array $data
* @param boolean $return
* @return mixed
*/
public function renderFile($context, $sourceFile, $data, $return)
{
$this->_stack[] = array(
'view' => $sourceFile,
'data' => $data,
);
if ($this->instance) {
return $this->instance->renderFile($context, $sourceFile, $data, $return);
}
return $context->renderInternal($sourceFile, $data, $return);
}
/**
* @param string $sourceFile
* @param string $viewFile
*/
public function generateViewFile($sourceFile, $viewFile)
{
if ($this->instance) {
return $this->instance->generateViewFile($sourceFile, $viewFile);
}
return null;
}
}