Skip to content
Permalink
Browse files

Also correctly disabled complex values.

  • Loading branch information...
markstory committed Jun 27, 2015
1 parent ece39d1 commit a2e2f16015ebf4d45d94842172b0cb820f6fa060
@@ -130,7 +130,7 @@ public function render(array $data, ContextInterface $context)
if ($this->_isSelected($checkbox['value'], $data['val'])) {
$checkbox['checked'] = true;
}
if ($this->_isDisabled($key, $data['disabled'])) {
if ($this->_isDisabled($checkbox['value'], $data['disabled'])) {
$checkbox['disabled'] = true;
}
if (empty($checkbox['id'])) {
@@ -98,6 +98,7 @@ public function testRenderComplex()
$data = [
'name' => 'Tags[id]',
'val' => 2,
'disabled' => ['1'],
'options' => [
['value' => '1', 'text' => 'CakePHP', 'data-test' => 'val'],
['value' => '2', 'text' => 'Development', 'class' => 'custom'],
@@ -107,6 +108,7 @@ public function testRenderComplex()
$expected = [
['div' => ['class' => 'checkbox']],
['input' => [
'disabled' => 'disabled',
'type' => 'checkbox',
'name' => 'Tags[id][]',
'value' => 1,

0 comments on commit a2e2f16

Please sign in to comment.
You can’t perform that action at this time.