Commit 9d01d1fb by Alexander Kochetov

DetailView correct regexp

parent 4fe0eeb1
...@@ -173,8 +173,8 @@ class DetailView extends Widget ...@@ -173,8 +173,8 @@ class DetailView extends Widget
foreach ($this->attributes as $i => $attribute) { foreach ($this->attributes as $i => $attribute) {
if (is_string($attribute)) { if (is_string($attribute)) {
if (!preg_match('/^(\w+)(\s*:\s*(\w+))?$/', $attribute, $matches)) { if (!preg_match('/^([\w\.]+)(:(\w*))?(:(.*))?$/', $attribute, $matches)) {
throw new InvalidConfigException('The attribute must be specified in the format of "Name" or "Name:Format"'); throw new InvalidConfigException('The attribute must be specified in the format of "name", "name:format" or "name:format:label"');
} }
$attribute = [ $attribute = [
'name' => $matches[1], 'name' => $matches[1],
......
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