Answer the question
In order to leave comments, you need to log in
Is it possible to anchor on redirect in PHP?
I have a table in it, the rows have data-key="11" where 11 is the id in the database.
The redirect looks like this: return $this->redirect(['todoist/index', 'id' => $model->id_zakaz]); But since I don’t have a page with tasks, there is nowhere to return by id, so I want it to be redirected to the task page and go to the table row as an anchor.
How can I add another anchor to it on data-key="11" :?
If I explained something in Chinese, ask). Thank you.
Answer the question
In order to leave comments, you need to log in
Good evening.
Approximately so
Translates to the index page, to <div id="custom-order-form">
PS
For the string, set the id parameter, which will contain the id of the entry in the database. Let this be the "id" column in the GridView, although this can be set for any cell.
[
'attribute' => 'id',
'headerOptions' => ['class' => 'head-id-column'],
'contentOptions' => function($model){
return ['id' => 'test-' . $model->id];
}
],
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function($model){
return ['id' => 'test-' . $model->id];
},
'columns' => [
// остальной код
],
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question