public createUrl ( string $position, |
||
$position | string | the position name |
$model | the data model | |
$key | mixed | the key associated with the data model |
$index | integer | the current row index |
Результат | string | the created URL |
public function createUrl($position, $model, $key, $index)
{
if (is_callable($this->urlCreator)) {
return call_user_func($this->urlCreator, $position, $model, $key, $index);
} else {
$params = array_merge(Yii::$app->getRequest()->getQueryParams(), is_array($key) ? $key : ['id' => (string) $key]);
$params[$this->positionParam] = $position;
$params[0] = $this->route;
return Url::toRoute($params);
}
}