Browse Source

Remove type as a separarte option.

Some FormHelper tests want to make buttons with no type. Therefore, it
cannot be a required attribute.
mark_story 12 years ago
parent
commit
d83c3050a8
2 changed files with 2 additions and 3 deletions
  1. 1 2
      src/View/Widget/Button.php
  2. 1 1
      tests/TestCase/View/Widget/ButtonTest.php

+ 1 - 2
src/View/Widget/Button.php

@@ -64,8 +64,7 @@ class Button implements WidgetInterface {
 		];
 		return $this->_templates->format('button', [
 			'text' => $data['escape'] ? h($data['text']) : $data['text'],
-			'type' => $data['type'],
-			'attrs' => $this->_templates->formatAttributes($data, ['type', 'text']),
+			'attrs' => $this->_templates->formatAttributes($data, ['text']),
 		]);
 	}
 

+ 1 - 1
tests/TestCase/View/Widget/ButtonTest.php

@@ -26,7 +26,7 @@ class ButtonTest extends TestCase {
 	public function setUp() {
 		parent::setUp();
 		$templates = [
-			'button' => '<button type="{{type}}"{{attrs}}>{{text}}</button>',
+			'button' => '<button{{attrs}}>{{text}}</button>',
 		];
 		$this->templates = new StringTemplate($templates);
 	}