yii2tech\admin\grid\PositionColumn::createUrl PHP Метод

createUrl() публичный Метод

This method is called for each button and each row.
public createUrl ( string $position, BaseActiveRecord $model, mixed $key, integer $index ) : string
$position string the position name
$model yii\db\BaseActiveRecord 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);
        }
    }