duplicate_named_route.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 3.3.1
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. * @var \Cake\Core\Exception\CakeException $error
  15. */
  16. use Cake\Error\Debugger;
  17. $this->layout = 'dev_error';
  18. $this->assign('title', 'Duplicate Named Route');
  19. $this->assign('templateName', 'duplicate_named_route.php');
  20. $attributes = $error->getAttributes();
  21. $this->start('subheading');
  22. ?>
  23. <strong>Error</strong>
  24. <?= h($error->getMessage()); ?>
  25. <?php $this->end() ?>
  26. <?php $this->start('file') ?>
  27. <p>Route names must be unique across your entire application.
  28. The same <code>_name</code> option cannot be used twice,
  29. even if the names occur in different routing scopes.
  30. Remove duplicate route names in your route configuration.</p>
  31. <?php if (isset($attributes['duplicate'])): ?>
  32. <h3>Duplicate Route</h3>
  33. <table cellspacing="0" cellpadding="0" width="100%">
  34. <tr><th>Template</th><th>Defaults</th><th>Options</th></tr>
  35. <?php $other = $attributes['duplicate']; ?>
  36. <tr>
  37. <td><?= h($other->template) ?></td>
  38. <td><div class="cake-debug" data-open-all="true"><?= Debugger::exportVar($other->defaults) ?></div></td>
  39. <td><div class="cake-debug" data-open-all="true"><?= Debugger::exportVar($other->options) ?></div></td>
  40. </tr>
  41. </table>
  42. <?php endif; ?>
  43. <?php $this->end() ?>