code: public function createUrl($action, $model, $key, $index)
      {
          if ($this->urlCreator instanceof Closure) {
              return call_user_func($this->urlCreator, $action, $model, $key, $index);
          } else {
              $params[0] = $this->controller ? $this->controller . '/' . $action : $action;
              return Url::toRoute($params);
          }
      }
docs: Creates a URL for the given action and model.
  This method is called for each button and each row.
  @param string $action the button name (or action ID)
  @param \yii\db\ActiveRecord $model the data model
  @param mixed $key the key associated with the data model
  @param integer $index the current row index
  @return string the created URL