From 53e249d2bee059efbab55d64657b8d415b03bf32 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 12 Jan 2014 20:47:18 -0500 Subject: [PATCH] Fixes #1921: Grid view ActionColumn now allow to name buttons like `{controller/action}` --- framework/CHANGELOG.md | 1 + framework/grid/ActionColumn.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 6419bdbff8..1fd71ebffc 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -61,6 +61,7 @@ Yii Framework 2 Change Log - Enh #1809: Added support for building "EXISTS" and "NOT EXISTS" query conditions (abdrasulov) - Enh #1852: ActiveRecord::tableName() now returns table name using DbConnection::tablePrefix (creocoder) - Enh #1894: The path aliases `@webroot` and `@web` are now available right after the application is initialized (qiangxue) +- Enh #1921: Grid view ActionColumn now allow to name buttons like `{controller/action}` (creocoder) - Enh: Added `favicon.ico` and `robots.txt` to default application templates (samdark) - Enh: Added `Widget::autoIdPrefix` to support prefixing automatically generated widget IDs (qiangxue) - Enh: Support for file aliases in console command 'message' (omnilight) diff --git a/framework/grid/ActionColumn.php b/framework/grid/ActionColumn.php index 26ed1c34af..43d56a3da4 100644 --- a/framework/grid/ActionColumn.php +++ b/framework/grid/ActionColumn.php @@ -122,7 +122,7 @@ class ActionColumn extends Column */ protected function renderDataCellContent($model, $key, $index) { - return preg_replace_callback('/\\{([\w\-]+)\\}/', function ($matches) use ($model, $key, $index) { + return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($model, $key, $index) { $name = $matches[1]; if (isset($this->buttons[$name])) { $url = $this->createUrl($name, $model, $key, $index);