missing_controller.ctp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since CakePHP(tm) v 0.10.0.1076
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. use Cake\Core\Plugin;
  16. use Cake\Core\Configure;
  17. use Cake\Utility\Inflector;
  18. $pluginDot = empty($plugin) ? null : $plugin . '.';
  19. $namespace = Configure::read('App.namespace');
  20. $prefixNs = '';
  21. $prefixPath = '';
  22. if (!empty($prefix)) {
  23. $prefix = Inflector::camelize($prefix);
  24. $prefixNs = '\\' . $prefix;
  25. $prefixPath = $prefix . DS;
  26. }
  27. if (!empty($plugin)) {
  28. $namespace = $plugin;
  29. }
  30. if (empty($plugin)) {
  31. $path = APP_DIR . DS . 'Controller' . DS . $prefixPath . h($class) . 'Controller.php' ;
  32. } else {
  33. $path = Plugin::path($plugin) . 'Controller' . DS . $prefixPath . h($class) . 'Controller.php';
  34. }
  35. ?>
  36. <h2><?php echo __d('cake_dev', 'Missing Controller'); ?></h2>
  37. <p class="error">
  38. <strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
  39. <?php echo __d('cake_dev', '%s could not be found.', '<em>' . h($pluginDot . $class) . 'Controller</em>'); ?>
  40. </p>
  41. <p class="error">
  42. <strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
  43. <?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . h($class) . 'Controller</em>', $path); ?>
  44. </p>
  45. <pre>
  46. &lt;?php
  47. namespace <?= h($namespace); ?>\Controller<?= h($prefixNs); ?>;
  48. use <?= h($namespace); ?>\Controller\AppController;
  49. class <?php echo h($class) . 'Controller extends ' . h($plugin); ?>AppController {
  50. }
  51. </pre>
  52. <p class="notice">
  53. <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
  54. <?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Error' . DS . 'missing_controller.ctp'); ?>
  55. </p>
  56. <?php echo $this->element('exception_stack_trace'); ?>