Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

91 line
3.0KB

  1. <?php
  2. /* @var $panel yii\debug\panels\AssetPanel */
  3. use yii\helpers\Html;
  4. use yii\helpers\Inflector;
  5. ?>
  6. <h1>Asset Bundles</h1>
  7. <?php if (empty($panel->data)) {
  8. echo '<p>No asset bundle was used.</p>';
  9. return;
  10. } ?>
  11. <div class="table-responsive">
  12. <table class="table table-striped table-bordered">
  13. <caption>
  14. <p>Total <b><?= count($panel->data) ?></b> asset bundles were loaded.</p>
  15. </caption>
  16. <?php
  17. foreach ($panel->data as $name => $bundle) {
  18. ?>
  19. <thead>
  20. <tr>
  21. <td colspan="2"><h3 id="<?= Inflector::camel2id($name) ?>"><?= $name ?></h3></td>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. <tr>
  26. <th>sourcePath</th>
  27. <td><?= Html::encode($bundle['sourcePath'] !== null ? $bundle['sourcePath'] : $bundle['basePath']) ?></td>
  28. </tr>
  29. <?php if ($bundle['basePath'] !== null): ?>
  30. <tr>
  31. <th>basePath</th>
  32. <td><?= Html::encode($bundle['basePath']) ?></td>
  33. </tr>
  34. <?php endif; ?>
  35. <?php if ($bundle['baseUrl'] !== null): ?>
  36. <tr>
  37. <th>baseUrl</th>
  38. <td><?= Html::encode($bundle['baseUrl']) ?></td>
  39. </tr>
  40. <?php endif; ?>
  41. <?php if (!empty($bundle['css'])): ?>
  42. <tr>
  43. <th>css</th>
  44. <td>
  45. <?= Html::ul($bundle['css'], [
  46. 'class' => 'assets',
  47. 'item' => function ($item) {
  48. if (is_array($item)) {
  49. $item = reset($item);
  50. }
  51. return Html::encode($item);
  52. }
  53. ]) ?>
  54. </td>
  55. </tr>
  56. <?php endif; ?>
  57. <?php if (!empty($bundle['js'])): ?>
  58. <tr>
  59. <th>js</th>
  60. <td>
  61. <?= Html::ul($bundle['js'], [
  62. 'class' => 'assets',
  63. 'item' => function ($item) {
  64. if (is_array($item)) {
  65. $item = reset($item);
  66. }
  67. return Html::encode($item);
  68. }
  69. ]) ?>
  70. </td>
  71. </tr>
  72. <?php endif; ?>
  73. <?php if (!empty($bundle['depends'])): ?>
  74. <tr>
  75. <th>depends</th>
  76. <td><ul class="assets">
  77. <?php foreach ($bundle['depends'] as $depend): ?>
  78. <li><?= Html::a($depend, '#' . Inflector::camel2id($depend)) ?></li>
  79. <?php endforeach; ?>
  80. </ul></td>
  81. </tr>
  82. <?php endif; ?>
  83. </tbody>
  84. <?php
  85. }
  86. ?>
  87. </table>
  88. </div>