I
I
Igor Braduloff2018-09-27 17:53:26
Yii
Igor Braduloff, 2018-09-27 17:53:26

Why does it not find view in Yii2?

Good afternoon! Tell me why he does not see the view?
model:
ChangePasswordForm.php
controller

public function actionChangePassword()
    {
     ....
        return $this->render('changePassword', [
            'modelChangePassword' => $modelChangePassword,
        ]);
    }

the view is located at
views/site/changePassword.php
the link to the view
Html::a('Сменить пароль ', ['/site/changepassword'], ['class' => 'btn btn-link'])

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-09-27
@pandinus

link to view

this is not a link to the view, it has nothing to do with the view
Here:
You have a link according to the route, probably the site controller and the changepassword action.
It has nothing to do with where you have the view.
Moreover, you have an action
and not
therefore the link should be /site/change-password
Why did you decide that it does not find the view, in theory it does not find the action. Give the text of the error.

D
Denis, 2018-09-27
@sidni

Well, the link should be at least

Html::a('Сменить пароль ', ['/site/change-password'], ['class' => 'btn btn-link'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question