Browse Source

set the class variable when throwing exception

So the missing_view template will be filled correctly and avoid the `$class variable not exist`when the view is rendered.
Also remove an extra html tag
antograssiot 10 years ago
parent
commit
1d53d8ef29
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/Template/Error/missing_view.ctp
  2. 1 1
      src/View/ViewBuilder.php

+ 1 - 1
src/Template/Error/missing_view.ctp

@@ -42,7 +42,7 @@ $this->start('subheading');
     Make sure your plugin <em><?= h($plugin) ?></em> is in the <?= h($pluginPath) ?> directory and was loaded.
     <?php endif ?>
     <?= $this->element('plugin_class_error', ['pluginPath' => $pluginPath]) ?>
-</p>
+
 <?php $this->end() ?>
 
 <?php $this->start('file') ?>

+ 1 - 1
src/View/ViewBuilder.php

@@ -322,7 +322,7 @@ class ViewBuilder implements JsonSerializable, Serializable
             $className = App::className($className, 'View', 'View');
         }
         if (!$className) {
-            throw new MissingViewException([$this->_className]);
+            throw new MissingViewException(['class' => $this->_className]);
         }
 
         $data = [