Class yii\debug\models\router\CurrentRoute

Inheritanceyii\debug\models\router\CurrentRoute » yii\base\Model
Subclassesyii\debug\models\Router
Available since extension's version2.0.8
Source Code https://github.com/yiisoft/yii2-debug/blob/master/src/models/router/CurrentRoute.php

CurrentRoute model

Public Methods

Hide inherited methods

Method Description Defined By
init() yii\debug\models\router\CurrentRoute

Property Details

Hide inherited properties

$action public property

Logged action.

public string $action ''
$count public property

Count, before match.

public integer $count 0
$hasMatch public property
public boolean $hasMatch false
$logs public property

Logged rules. `php [ [

 'rule' => (string),
 'match' => (bool),
 'parent'=> parent class (string)

] ] `

public array $logs = []
$message public property

Info message.

public string|null $message null
$messages public property

Logged messages.

public array $messages = []
$route public property

Logged route.

public string $route ''

Method Details

Hide inherited methods

init() public method

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];
        }
    }
}