Commit 2b2c22ee by Qiang Xue

Fixes #980: Changed the default way of generating action URLs for ActionColumn.

parent 21342c6d
......@@ -72,12 +72,11 @@ class ActionColumn extends Column
if ($this->urlCreator instanceof Closure) {
return call_user_func($this->urlCreator, $model, $action);
} else {
$route = Inflector::camel2id(StringHelper::basename(get_class($model))) . '/' . $action;
$params = $model->getPrimaryKey(true);
if (count($params) === 1) {
$params = array('id' => reset($params));
}
return Yii::$app->getUrlManager()->createUrl($route, $params);
return Yii::$app->controller->createUrl($action, $params);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment