Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: renan/CakePHP-Bootstrap
base: 5848585499
...
head fork: renan/CakePHP-Bootstrap
compare: d8d9e0ac5f
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 19, 2012
ceeram ceeram Not been using it, just thought it might help a0af998
Renan Gonçalves Merge pull request #1 from ceeram/patch-1
Not been using it, just thought it might help
d8d9e0a
Showing with 9 additions and 15 deletions.
  1. +9 −15 View/Helper/BootstrapFormHelper.php
24 View/Helper/BootstrapFormHelper.php
View
@@ -12,29 +12,23 @@ public function create($model = null, $options = array()) {
$options = $model;
$model = null;
}
- $defaults = array(
- 'class' => 'form-horizontal',
- );
- $options = Set::merge($defaults, $options);
-
- return parent::create($model, $options);
- }
-
-/**
- * Add divs and classes necessary for bootstrap
- *
- */
- public function input($fieldName, $options = array()) {
- $defaults = array(
+ $inputDefaults = array(
'div' => array('class' => 'control-group'),
'label' => array('class' => 'control-label'),
'between' => '<div class="controls">',
'after' => '</div>',
'format' => array('before', 'label', 'between', 'input', 'error', 'after')
);
+ if (!empty($options['inputDefaults'])) {
+ $inputDefaults = Set::merge($inputDefaults, $options['inputDefaults']);
+ }
+ $defaults = array(
+ 'class' => 'form-horizontal',
+ 'inputDefaults' => $inputDefaults
+ );
$options = Set::merge($defaults, $options);
- return parent::input($fieldName, $options);
+ return parent::create($model, $options);
}
/**

No commit comments for this range

Something went wrong with that request. Please try again.