Browse Source

no default defaults

AD7six 12 years ago
parent
commit
bef817049a

+ 2 - 2
src/View/Helper/FormHelper.php

@@ -76,7 +76,7 @@ class FormHelper extends Helper {
 		],
 		'widgets' => [],
 		'registry' => null,
-		'defaultTemplates' => [
+		'templates' => [
 			'button' => '<button{{attrs}}>{{text}}</button>',
 			'checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>',
 			'checkboxContainer' => '<div class="checkbox">{{input}}{{label}}</div>',
@@ -2237,7 +2237,7 @@ class FormHelper extends Helper {
  * @return void
  */
 	public function resetTemplates() {
-		$this->templates($this->_defaultConfig['defaultTemplates']);
+		$this->templates($this->_defaultConfig['templates']);
 	}
 
 /**

+ 1 - 1
src/View/Helper/PaginatorHelper.php

@@ -49,7 +49,7 @@ class PaginatorHelper extends Helper {
  */
 	protected $_defaultConfig = [
 		'options' => [],
-		'defaultTemplates' => [
+		'templates' => [
 			'nextActive' => '<li class="next"><a rel="next" href="{{url}}">{{text}}</a></li>',
 			'nextDisabled' => '<li class="next disabled"><span>{{text}}</span></li>',
 			'prevActive' => '<li class="prev"><a rel="prev" href="{{url}}">{{text}}</a></li>',

+ 1 - 1
src/View/Helper/SessionHelper.php

@@ -36,7 +36,7 @@ class SessionHelper extends Helper {
  * @var array
  */
 	protected $_defaultConfig = [
-		'defaultTemplates' => [
+		'templates' => [
 			'flash' => '<div id="{{key}}-message" class="{{class}}">{{message}}</div>'
 		]
 	];

+ 1 - 3
src/View/Helper/StringTemplateTrait.php

@@ -66,12 +66,10 @@ trait StringTemplateTrait {
 			$class = $this->config('templateClass') ?: '\Cake\View\StringTemplate';
 			$this->_templater = new $class;
 
-			$defaults = $this->config('defaultTemplates');
-			$this->_templater->add($defaults);
-
 			$templates = $this->config('templates');
 			if ($templates) {
 				if (is_string($templates)) {
+					$this->_templater->add($this->_defaultConfig['templates']);
 					$this->_templater->load($templates);
 				} else {
 					$this->_templater->add($templates);