Browse Source

Rename `Container` templates to `Wrapper`.

Container will be overloaded soon as it cannot be used for both the
widget container used by input() and the wrapping elements for
individual input/label elements.

Refs #3651
mark_story 11 years ago
parent
commit
c5b9252776

+ 2 - 2
src/View/Widget/MultiCheckbox.php

@@ -47,7 +47,7 @@ class MultiCheckbox implements WidgetInterface {
  *
  * - `checkbox` Renders checkbox input controls. Accepts
  *   the `name`, `value` and `attrs` variables.
- * - `checkboxContainer` Renders the containing div/element for
+ * - `checkboxWrapper` Renders the containing div/element for
  *   a checkbox and its label. Accepts the `input`, and `label`
  *   variables.
  *
@@ -167,7 +167,7 @@ class MultiCheckbox implements WidgetInterface {
 		}
 		$label = $this->_label->render($labelAttrs, $context);
 
-		return $this->_templates->format('checkboxContainer', [
+		return $this->_templates->format('checkboxWrapper', [
 			'label' => $label,
 			'input' => $input
 		]);

+ 2 - 2
src/View/Widget/Radio.php

@@ -50,7 +50,7 @@ class Radio implements WidgetInterface {
  *
  * - `radio` Used to generate the input for a radio button.
  *   Can use the following variables `name`, `value`, `attrs`.
- * - `radioContainer` Used to generate the container element for
+ * - `radioWrapper` Used to generate the container element for
  *   the radio + input element. Can use the `input` and `label`
  *   variables.
  *
@@ -187,7 +187,7 @@ class Radio implements WidgetInterface {
 			$escape
 		);
 
-		return $this->_templates->format('radioContainer', [
+		return $this->_templates->format('radioWrapper', [
 			'input' => $input,
 			'label' => $label,
 		]);

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

@@ -34,7 +34,7 @@ class MultiCheckboxTest extends TestCase {
 		$templates = [
 			'checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>',
 			'label' => '<label{{attrs}}>{{text}}</label>',
-			'checkboxContainer' => '<div class="checkbox">{{input}}{{label}}</div>',
+			'checkboxWrapper' => '<div class="checkbox">{{input}}{{label}}</div>',
 		];
 		$this->templates = new StringTemplate($templates);
 		$this->context = $this->getMock('Cake\View\Form\ContextInterface');

+ 3 - 3
tests/TestCase/View/Widget/RadioTest.php

@@ -35,7 +35,7 @@ class RadioTest extends TestCase {
 		$templates = [
 			'radio' => '<input type="radio" name="{{name}}" value="{{value}}"{{attrs}}>',
 			'label' => '<label{{attrs}}>{{text}}</label>',
-			'radioContainer' => '{{input}}{{label}}',
+			'radioWrapper' => '{{input}}{{label}}',
 		];
 		$this->templates = new StringTemplate($templates);
 		$this->context = $this->getMock('Cake\View\Form\ContextInterface');
@@ -335,7 +335,7 @@ class RadioTest extends TestCase {
 	public function testRenderInputInsideLabel() {
 		$this->templates->add([
 			'label' => '<label{{attrs}}>{{input}}{{text}}</label>',
-			'radioContainer' => '{{label}}',
+			'radioWrapper' => '{{label}}',
 		]);
 		$label = new Label($this->templates);
 		$radio = new Radio($this->templates, $label);
@@ -558,7 +558,7 @@ class RadioTest extends TestCase {
  */
 	public function testRenderContainerTemplate() {
 		$this->templates->add([
-			'radioContainer' => '<div class="radio">{{input}}{{label}}</div>'
+			'radioWrapper' => '<div class="radio">{{input}}{{label}}</div>'
 		]);
 		$label = new Label($this->templates);
 		$radio = new Radio($this->templates, $label);