Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no default defaults
  • Loading branch information
AD7six committed Mar 28, 2014
1 parent 0278300 commit bef8170
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/View/Helper/FormHelper.php
Expand Up @@ -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>',
Expand Down Expand Up @@ -2237,7 +2237,7 @@ public function widget($name, array $data = []) {
* @return void
*/
public function resetTemplates() {
$this->templates($this->_defaultConfig['defaultTemplates']);
$this->templates($this->_defaultConfig['templates']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/PaginatorHelper.php
Expand Up @@ -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>',
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/SessionHelper.php
Expand Up @@ -36,7 +36,7 @@ class SessionHelper extends Helper {
* @var array
*/
protected $_defaultConfig = [
'defaultTemplates' => [
'templates' => [
'flash' => '<div id="{{key}}-message" class="{{class}}">{{message}}</div>'
]
];
Expand Down
4 changes: 1 addition & 3 deletions src/View/Helper/StringTemplateTrait.php
Expand Up @@ -66,12 +66,10 @@ public function templater() {
$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);
Expand Down

0 comments on commit bef8170

Please sign in to comment.