check current route yii2

I just started migrating from laravel to yii2

In Laravel, I had a moment when I checked the current route, and if we are on this page, then we leave only the text, and if not, then we make this text a link

@if(Route::currentRouteName() === 'contact')
  <span class="contact-link active">contact</span>
@else
  <a href="{{ route('contact') }}" class="contact-link">contact</a>
@endif

Now I want to do exactly the same on yii2

With a regular link, everything is clear

<a href="<?= Url::to(['/contact']) ?>" class="contact-link">contact</a>

But how can you check the current page?