Permalink
Browse files

Not been using it, just thought it might help

  • Loading branch information...
1 parent 5848585 commit a0af9984373665aaa9daf134bf70efdbcd9f69aa @ceeram ceeram committed Mar 19, 2012
Showing with 9 additions and 15 deletions.
  1. +9 −15 View/Helper/BootstrapFormHelper.php
@@ -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);
}
/**

0 comments on commit a0af998

Please sign in to comment.