callStackItem.php 1.7 KB
Newer Older
resurtm committed
1 2 3
<?php
/**
 * @var \yii\base\View $this
4 5 6 7
 * @var string|null $file
 * @var integer|null $line
 * @var string|null $class
 * @var string|null $method
resurtm committed
8 9 10 11
 * @var integer $index
 * @var string[] $lines
 * @var integer $begin
 * @var integer $end
12
 * @var \yii\base\ErrorHandler $context
resurtm committed
13
 */
14
$context = $this->context;
resurtm committed
15
?>
16 17
<li class="<?php if (!$context->isCoreFile($file) || $index === 1) echo 'application'; ?> call-stack-item"
	data-line="<?php echo (int)($line - $begin - 1); ?>">
resurtm committed
18 19
	<div class="element-wrap">
		<div class="element">
20
			<span class="item-number"><?php echo (int)$index; ?>.</span>
21 22 23 24 25 26 27 28 29
			<span class="text"><?php if ($file !== null) echo 'in ' . $context->htmlEncode($file); ?></span>
			<?php if ($method !== null): ?>
				<span class="call">
					<?php if ($file !== null) echo '&ndash;' ?>
					<?php if ($class !== null) echo $context->addTypeLinks($class) . '→'; ?><?php echo $context->addTypeLinks($method . '()'); ?>
				</span>
			<?php endif; ?>
			<span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
			<span class="line"><?php if ($line !== null) echo (int)$line; ?></span>
resurtm committed
30 31
		</div>
	</div>
32 33
	<?php if (!empty($lines)): ?>
		<div class="code-wrap">
34 35
			<div class="error-line"></div>
			<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
36
			<div class="code">
37
				<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?php echo (int)($i + 1); ?></span><?php endfor; ?>
38 39 40 41 42 43
				<pre><?php
					// fill empty lines with a whitespace to avoid rendering problems in opera
					for ($i = $begin; $i <= $end; ++$i) {
						echo (trim($lines[$i]) == '') ? " \n" : $context->htmlEncode($lines[$i]);
					}
				?></pre>
44
			</div>
resurtm committed
45
		</div>
46
	<?php endif; ?>
resurtm committed
47
</li>