$_attributes
$_attributes : array
Array of attributes that are passed in from the constructor, and made available in the view when a development error is displayed.
Exception raised when a route names used twice.
__construct(string|array $message, integer|null $code = 404, \Exception|null $previous = null)
Constructor.
Allows you to create exceptions that are treated as framework errors and disabled when debug = 0.
string|array | $message | Either the string of the error message, or an array of attributes that are made available in the view, and sprintf()'d into Exception::$_messageTemplate |
integer|null | $code | The code of the error, is also the HTTP status code for the error. |
\Exception|null | $previous | the previous exception. |
responseHeader(string|array|null $header = null, string|null $value = null) : array
Get/set the response header to be used
See also Cake\Http\Response::withHeader()
string|array|null | $header | An array of header strings or a single header string
|
string|null | $value | The header value. |
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @since 3.3.1
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Routing\Exception;
use Cake\Core\Exception\Exception;
/**
* Exception raised when a route names used twice.
*/
class DuplicateNamedRouteException extends Exception
{
/**
* {@inheritDoc}
*/
protected $_messageTemplate = 'A route named "%s" has already been connected to "%s".';
/**
* {@inheritDoc}
*/
public function __construct($message, $code = 404, $previous = null)
{
if (is_array($message) && isset($message['message'])) {
$this->_messageTemplate = $message['message'];
}
parent::__construct($message, $code, $previous);
}
}