mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
First pass at making MissingView/MissingLayout exceptions show all
paths. Showing all the paths a template file could be located help expose developers to the view path cascade and helps ensure we don't tell people the wrong place to put a view file. Refs #3712
This commit is contained in:
parent
7ea6626a15
commit
e548dfcaea
3 changed files with 28 additions and 2 deletions
|
@ -25,6 +25,19 @@
|
|||
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'Confirm you have created the file: %s', '<em>' . h($file) . '</em>'); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should create "<?php echo h($file); ?>" in one of he following paths:
|
||||
</p>
|
||||
<ul>
|
||||
<?php
|
||||
$paths = $this->_paths($this->plugin);
|
||||
foreach ($paths as $path):
|
||||
echo sprintf('<li>%s%s%s</li>', h($path), DS, h($file));
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="notice">
|
||||
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_layout.ctp'); ?>
|
||||
|
|
|
@ -25,6 +25,19 @@
|
|||
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'Confirm you have created the file: %s', h($file)); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should create "<?php echo h($file); ?>" in one of he following paths:
|
||||
</p>
|
||||
<ul>
|
||||
<?php
|
||||
$paths = $this->_paths($this->plugin);
|
||||
foreach ($paths as $path):
|
||||
echo sprintf('<li>%s%s%s</li>', h($path), DS, h($file));
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="notice">
|
||||
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_view.ctp'); ?>
|
||||
|
|
|
@ -1019,7 +1019,7 @@ class View extends Object {
|
|||
}
|
||||
}
|
||||
}
|
||||
throw new MissingViewException(array('file' => $defaultPath . $name . $this->ext));
|
||||
throw new MissingViewException(array('file' => $name . $this->ext));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1072,7 +1072,7 @@ class View extends Object {
|
|||
}
|
||||
}
|
||||
}
|
||||
throw new MissingLayoutException(array('file' => $paths[0] . $file . $this->ext));
|
||||
throw new MissingLayoutException(array('file' => $file . $this->ext));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue