K
K
Ken Jee2016-09-18 12:41:04
Yii
Ken Jee, 2016-09-18 12:41:04

How to bind a long URL to a controller action in Yii2?

Unable to bind the URL /user/confirm/email/resent to the actionConfirmEmailResent method (action) of the UserController. How to do it right?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Ken Jee, 2016-09-18
@Machez

The problem was solved in the following way:

...
'components' => [
    'urlManager' => [
        ...
        'rules' => [
            '/user/confirm/email/resent'=>'user/confirm-email-resent',
            ...
        ],
    ],
    ...

D
Dmitry, 2016-09-18
@slo_nik

Good afternoon.
try this
/user/confirm-email-resent

@
@pylliok, 2016-09-18
_

You can do this using regular expressions in rules => [ ]
For example sait.ru/index If you want this page to open at sait.ru/user/confirm-email-resent you write rules => [ `user/confirm- email-resent` => `index`]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question