Last active
August 29, 2015 14:00
-
-
Save jippi/11039395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/src/View/Helper/FormHelper.php w/src/View/Helper/FormHelper.php | |
index f686f11..4d6051b 100755 | |
--- i/src/View/Helper/FormHelper.php | |
+++ w/src/View/Helper/FormHelper.php | |
@@ -105,6 +105,7 @@ class FormHelper extends Helper { | |
'groupContainer' => '<div class="input {{type}}{{required}}">{{content}}</div>', | |
'groupContainerError' => '<div class="input {{type}}{{required}} error">{{content}}{{error}}</div>', | |
'submitContainer' => '<div class="submit">{{content}}</div>', | |
+ 'rawContainer' => '{{input}}' | |
] | |
]; | |
@@ -844,8 +845,15 @@ class FormHelper extends Helper { | |
$input = $this->_getInput($fieldName, $options); | |
$label = $this->_getLabel($fieldName, compact('input', 'label') + $options); | |
- $groupTemplate = $options['type'] === 'checkbox' ? 'checkboxFormGroup' : 'formGroup'; | |
- $result = $this->formatTemplate($groupTemplate, compact('input', 'label')); | |
+ if ($options['type'] === 'checkbox') { | |
+ $groupTemplate = 'checkboxFormGroup'; | |
+ } elseif ($options['type'] === 'hidden') { | |
+ $groupTemplate = 'rawContainer'; | |
+ } else { | |
+ $groupTemplate = 'formGroup'; | |
+ } | |
+ | |
+ $result = $this->formatTemplate($groupTemplate, compact('input', 'label', 'error')); | |
if ($options['type'] !== 'hidden') { | |
$result = $this->formatTemplate($template, [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = [ | |
'fieldset' => '{{content}}', | |
'formGroup' => '{{label}}<div class="col-sm-10">{{input}}{{error}}</div>', | |
'groupContainer' => '<div class="input {{type}}{{required}} form-group">{{content}}</div>', | |
'groupContainerError' => '<div class="input {{type}}{{required}} form-group has-error">{{content}}</div>', | |
'error' => '<div class="help-block error-message">{{content}}</div>', | |
'checkboxFormGroup' => '{{label}}<div class="col-sm-10">{{input}}</div>', | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment