Class yii\debug\models\router\CurrentRoute
Inheritance | yii\debug\models\router\CurrentRoute » yii\base\Model |
---|---|
Subclasses | yii\debug\models\Router |
Available since extension's version | 2.0.8 |
Source Code | https://github.com/yiisoft/yii2-debug/blob/master/src/models/router/CurrentRoute.php |
CurrentRoute model
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$action | string | Logged action. | yii\debug\models\router\CurrentRoute |
$count | integer | Count, before match. | yii\debug\models\router\CurrentRoute |
$hasMatch | boolean | yii\debug\models\router\CurrentRoute | |
$logs | array | Logged rules. | yii\debug\models\router\CurrentRoute |
$message | string|null | Info message. | yii\debug\models\router\CurrentRoute |
$messages | array | Logged messages. | yii\debug\models\router\CurrentRoute |
$route | string | Logged route. | yii\debug\models\router\CurrentRoute |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | yii\debug\models\router\CurrentRoute |
Property Details
Logged rules.
`
php
[
[
'rule' => (string),
'match' => (bool),
'parent'=> parent class (string)
]
]
`
Method Details
public void init ( ) |
public function init()
{
parent::init();
$last = null;
foreach ($this->messages as $message) {
if ($message[1] === Logger::LEVEL_TRACE && is_string($message[0])) {
$this->message = $message[0];
} elseif (isset($message[0]['rule'], $message[0]['match'])) {
if (!empty($last['parent']) && $last['parent'] === $message[0]['rule']) {
continue;
}
$this->logs[] = $message[0];
++$this->count;
if ($message[0]['match']) {
$this->hasMatch = true;
}
$last = $message[0];
}
}
}