Skip to content

Commit

Permalink
Merge pull request #51 from Wouter0100/patch-1
Browse files Browse the repository at this point in the history
Wrong usage of _extractOption in NavbarHelper
  • Loading branch information
Holt59 committed Sep 9, 2015
2 parents 4f724d9 + fe81db7 commit a1bae25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/View/Helper/BootstrapNavbarHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function create ($brand, $options = []) {
$brand = $this->Html->link ($brand, '/', ['class' => 'navbar-brand', 'escape' => false]) ;
}
else if (is_array($brand) && array_key_exists('url', $brand)) {
$brandOptions = $this->_extractOption ($brand, 'options', []) ;
$brandOptions = $this->_extractOption ('options', $brand, []) ;
$brandOptions = $this->addClass ($brandOptions, 'navbar-brand') ;
$brand = $this->Html->link ($brand['name'], $brand['url'], $brandOptions) ;
}
Expand Down Expand Up @@ -237,7 +237,7 @@ public function header ($name, array $options = []) {
*
**/
public function text ($text, $options = []) {
$tag = $this->_extractOption ($options, 'tag', 'p') ;
$tag = $this->_extractOption ('tag', $options, 'p') ;
$options = $this->addClass ($options, 'navbar-text') ;
$text = preg_replace_callback ('/<a([^>]*)?>([^<]*)?<\/a>/i', function ($matches) {
$attrs = preg_replace_callback ('/class="(.*)?"/', function ($m) {
Expand All @@ -262,7 +262,7 @@ public function text ($text, $options = []) {
*
**/
public function searchForm ($model = null, $options = []) {
$align = $this->_extractOption ($options, 'align', 'left') ;
$align = $this->_extractOption ('align', $options, 'left') ;
unset ($options['align']) ;
$options = $this->addClass($options, ['navbar-form', 'navbar-'.$align]) ;
return $this->Form->searchForm($model, $options) ;
Expand Down

0 comments on commit a1bae25

Please sign in to comment.