Answer the question
In order to leave comments, you need to log in
Yii2, what's wrong with yii\helpers\Url::to() ??
Good day to all !
A couple of days ago I started learning the Yii2 framework. I got to the topic of data validation and came across a captcha widget. When creating it in widget -> template, I wrote a template for displaying captcha in the form, but there was a problem! By specifying the captchaAction => \yii\helpers\Url::to(['main/captcha']) parameter, the request for an image does not go to the MainController to the captcha method, but makes a request to the page localhost/yii.loc/frontend/web/yii. loc/frontend/web/main/main/captcha and in theory it should be localhost/yii.loc/frontend/web/main/main/captcha.
Please help me understand why this is happening!
PS Replaced captchaAction => captchaAction => \yii\helpers\Url::to(['main/captcha']) with captchaAction => 'main/captcha' everything worked fine!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question