Skip to content

Commit 3ac2639

Browse files
author
Eugene Tupikov
committed
#278 allow name '0'
1 parent 3d4895c commit 3ac2639

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/components/BaseColumn.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function init()
201201
$this->name = self::DEFAULT_STATIC_COLUMN_NAME;
202202
}
203203

204-
if (empty($this->name)) {
204+
if ($this->isNameEmpty()) {
205205
throw new InvalidConfigException("The 'name' option is required.");
206206
}
207207

@@ -210,6 +210,19 @@ public function init()
210210
}
211211
}
212212

213+
private function isNameEmpty()
214+
{
215+
if (empty($this->name)) {
216+
if ($this->name === 0 || $this->name === '0') {
217+
return false;
218+
}
219+
220+
return true;
221+
}
222+
223+
return false;
224+
}
225+
213226
/**
214227
* @return bool whether the type of column is hidden input.
215228
*/

0 commit comments

Comments
 (0)