missing_template.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 0.10.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. * @var string $file
  15. * @var array<string> $paths
  16. */
  17. use Cake\Utility\Inflector;
  18. $this->layout = 'dev_error';
  19. $this->assign('title', 'Missing Template');
  20. $this->assign('templateName', 'missing_template.php');
  21. $isEmail = strpos($file, 'Email/') === 0;
  22. $this->start('subheading');
  23. ?>
  24. <?php if ($isEmail): ?>
  25. <strong>Error</strong>
  26. <?= sprintf('The template %s</em> was not found.', h($file)); ?>
  27. <?php else: ?>
  28. <strong>Error</strong>
  29. <?= sprintf(
  30. 'The view for <em>%sController::%s()</em> was not found.',
  31. h(Inflector::camelize($this->request->getParam('controller', ''))),
  32. h($this->request->getParam('action'))
  33. ); ?>
  34. <?php endif ?>
  35. <?php $this->end() ?>
  36. <?php $this->start('file') ?>
  37. <p>
  38. <?= sprintf('Confirm you have created the file: "%s"', h($file)) ?>
  39. in one of the following paths:
  40. </p>
  41. <ul>
  42. <?php
  43. foreach ($paths as $path):
  44. if (strpos($path, CORE_PATH) !== false) {
  45. continue;
  46. }
  47. echo sprintf('<li>%s%s</li>', h($path), h($file));
  48. endforeach;
  49. ?>
  50. </ul>
  51. <?php $this->end() ?>