K
K
Kanat2019-10-27 17:17:56
Yii
Kanat, 2019-10-27 17:17:56

How to get id in Yii2 if it's not a number?

Comrades, how in yii2 to get $id in the standard actionView controller method, if $id is a string?
I work with mongodb, where id is of type string, and if I access site.ru/controller/05as it gives a 404 error, and if I enter a number, it goes to the address

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vitaly_74, 2019-11-03
@harasaev

there is a urlManager in config.php - find your link there, remove various symbols from the id, for example it was
then everything will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question