Yii2: How to make a rule for UrlManager in the breadcrumbs and the actions of the GridView?

Hello.

There is a small project, it made routing (just started to deal with it). There is one page which display the data using GridView (generated by Gii).

On this page there is a table, and bread crumbs.

In the breadcrumbs address: "pdf.site/pdf/index" superfluous "index"

In the actions table "pdf.site/pdf/update?id=9" then I want to replace the "udpate?id=9" "update/9" (if just address enter the url "pdf.site/pdf/update/9" it works, the rule for this.

Please tell me, can not understand.
August 23rd 19 at 10:58
2 answers
August 23rd 19 at 11:00
Good afternoon.
In the configuration the comment section urlManager removed?
File .htaccess created?
Yes, all this is done. Written some rules. For example when you type into the address bar pdf.site/pdf/update/9 everything is working correctly. - Sid.Gutkowski commented on August 23rd 19 at 11:03
: How do you specify the address in the breadcrumbs? - erna_Hane15 commented on August 23rd 19 at 11:06
$this->params['breadcrumbs'][] = $this->title; - Sid.Gutkowski commented on August 23rd 19 at 11:09
: understand the function of construction of the url for the action buttons.

'urlCreator'=>function($action, $data){
return \yii\helpers\Url::to(['/pdf/' . $action . '/'. $data->id]);
}

BUT! There is another problem. This rule specifies the new URL for all buttons. What should I do if I need to change the url only for one button ? - Sid.Gutkowski commented on August 23rd 19 at 11:12
:
$this->params['breadcrumbs'][] = ['label' => $model->country, 'url' => ['view', 'id' => $model->id]];
- erna_Hane15 commented on August 23rd 19 at 11:15
: A function to remove - erna_Hane15 commented on August 23rd 19 at 11:18
August 23rd 19 at 11:02
Hard to say without the code why, but by far the two reasons:
or not properly configured url manager
or not properly formed links
Show Your config and code which formed links - is the answer
Sam understood. Thank you. - Sid.Gutkowski commented on August 23rd 19 at 11:05

Find more questions by tags PHPProcessing URLYii