2
votes

I'm creating a login and logout page on a custom template in yii2. I got an error because of routing.

Please tell how to import Url or manage url.

Class Url not found

1
if there is code, add it as text/code block to your question. do not add a screenshot of your code! if you want help from coders, give them code. that is their language. - hoijui

1 Answers

14
votes

Add Url class in top of the page.

use yii\helpers\Url;

Refer Url::to()