A
A
Alexander Sharomet2017-03-27 16:20:24
Yii
Alexander Sharomet, 2017-03-27 16:20:24

Why does Yii2 escape characters in url?

Hello.
Tell me why Yii2 can escape some links?
Example:
instead of ?id=18b97aa654bce41356002559 it shows ?id%5Boid%5D=18b97aa654bce41356002559. Of course the link doesn't work.
I am using mongodb.
Perhaps the problem is that mongodb uses id as an object. how to get it then?

<a href="<?= \yii\helpers\Url::to(['categories/view', 'id' => $categories['_id']]) ?>"><?= $categories['name'] ?></a>

How to solve this problem? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sharomet, 2017-03-27
@sharomet

figured it out myself
just convert object to string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question