Skip to content

Commit a1bae25

Browse files
committed
Merge pull request #51 from Wouter0100/patch-1
Wrong usage of _extractOption in NavbarHelper
2 parents 4f724d9 + fe81db7 commit a1bae25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/View/Helper/BootstrapNavbarHelper.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function create ($brand, $options = []) {
154154
$brand = $this->Html->link ($brand, '/', ['class' => 'navbar-brand', 'escape' => false]) ;
155155
}
156156
else if (is_array($brand) && array_key_exists('url', $brand)) {
157-
$brandOptions = $this->_extractOption ($brand, 'options', []) ;
157+
$brandOptions = $this->_extractOption ('options', $brand, []) ;
158158
$brandOptions = $this->addClass ($brandOptions, 'navbar-brand') ;
159159
$brand = $this->Html->link ($brand['name'], $brand['url'], $brandOptions) ;
160160
}
@@ -237,7 +237,7 @@ public function header ($name, array $options = []) {
237237
*
238238
**/
239239
public function text ($text, $options = []) {
240-
$tag = $this->_extractOption ($options, 'tag', 'p') ;
240+
$tag = $this->_extractOption ('tag', $options, 'p') ;
241241
$options = $this->addClass ($options, 'navbar-text') ;
242242
$text = preg_replace_callback ('/<a([^>]*)?>([^<]*)?<\/a>/i', function ($matches) {
243243
$attrs = preg_replace_callback ('/class="(.*)?"/', function ($m) {
@@ -262,7 +262,7 @@ public function text ($text, $options = []) {
262262
*
263263
**/
264264
public function searchForm ($model = null, $options = []) {
265-
$align = $this->_extractOption ($options, 'align', 'left') ;
265+
$align = $this->_extractOption ('align', $options, 'left') ;
266266
unset ($options['align']) ;
267267
$options = $this->addClass($options, ['navbar-form', 'navbar-'.$align]) ;
268268
return $this->Form->searchForm($model, $options) ;

0 commit comments

Comments
 (0)