M
M
McMike2017-06-09 05:55:57
Yii
McMike, 2017-06-09 05:55:57

Is it possible to remove a parameter from Url?

I make a link
Html::a(Yii::t('app', 'goto'), ['/url', 'id' => $id])->menu_id], ['class' => 'btn btn-primary', 'data-pjax' => 0]) Accordingly
, I get to the page with the get-parameter url?
parameter?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Arman, 2017-06-09
@Arik

send by POST method? via form

M
Maxim Fedorov, 2017-06-09
@qonand

If your id was static (not changeable), then your task could be solved using the rules of the url manager. But taking into account the fact that the id can change, the url manager will not help you in any way, it can remove the id from the link, but when you go to it, you will not be able to get the get-parameter, because it simply will not be on the client side. Accordingly, you need to use POST as Arik said , or even abandon the idea of ​​\u200b\u200bhiding the parameter

K
Kirill Zhilyaev, 2017-06-09
@kirill_782

Look towards rewrite.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question