detail.php 1.96 KB
Newer Older
1 2 3 4
<?php
/* @var $panel yii\debug\panels\AssetPanel */

use yii\helpers\Html;
5
use yii\helpers\Inflector;
6
?>
7
<h1>Asset Bundles</h1>
8

9 10 11 12
<?php if (empty($panel->data)) {
    echo '<p>No asset bundle was used.</p>';
    return;
} ?>
13 14
<table class="table table-striped table-bordered">
    <caption>
15
        <p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p>
16 17
    </caption>
<?php
18
foreach ($panel->data as $name => $bundle) {
19 20 21
?>
    <thead>
        <tr>
22
            <td colspan="2"><h3 id="<?= Inflector::camel2id($name) ?>"><?= $name ?></h3></td>
23 24 25 26 27
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>sourcePath</th>
28
            <td><?= Html::encode($bundle['sourcePath'] !== null ? $bundle['sourcePath'] : $bundle['basePath']) ?></td>
29
        </tr>
30 31 32 33 34 35 36 37 38 39 40 41 42
        <?php if ($bundle['basePath'] !== null): ?>
            <tr>
                <th>basePath</th>
                <td><?= Html::encode($bundle['basePath']) ?></td>
            </tr>
        <?php endif; ?>
        <?php if ($bundle['baseUrl'] !== null): ?>
            <tr>
                <th>baseUrl</th>
                <td><?= Html::encode($bundle['baseUrl']) ?></td>
            </tr>
        <?php endif; ?>
        <?php if (!empty($bundle['css'])): ?>
43 44
        <tr>
            <th>css</th>
45
            <td><?= Html::ul($bundle['css'], ['class' => 'assets']) ?></td>
46
        </tr>
47 48
        <?php endif; ?>
        <?php if (!empty($bundle['js'])): ?>
49 50
        <tr>
            <th>js</th>
51
            <td><?= Html::ul($bundle['js'], ['class' => 'assets']) ?></td>
52
        </tr>
53 54
        <?php endif; ?>
        <?php if (!empty($bundle['depends'])): ?>
55 56
        <tr>
            <th>depends</th>
57 58 59 60 61
            <td><ul class="assets">
                <?php foreach ($bundle['depends'] as $depend): ?>
                    <li><?= Html::a($depend, '#' . Inflector::camel2id($depend)) ?></li>
                <?php endforeach; ?>
            </ul></td>
62
        </tr>
63
        <?php endif; ?>
64 65 66 67 68
    </tbody>
<?php
}
?>
</table>