has($name)): $classes = 'form-group has-error has-feedback'; break; case (!is_null($warnings) && $warnings->has($name)): $classes = 'form-group has-warning has-feedback'; break; case (!is_null($successes) && $successes->has($name)): $classes = 'form-group has-success has-feedback'; break; default: $classes = 'form-group'; break; } /* * Add some HTML. */ $label = isset($options['label']) ? $options['label'] : ucfirst($name); $html = '
'; $html .= ''; $html .= '
'; /* * Switch input type: */ switch ($type) { case 'text': $html .= \Form::input('text', $name, $value, $options); break; case 'number': $html .= '
'; $html .= \Form::input('number', $name, $value, $options); $html .= '
'; break; case 'date': $html .= \Form::input('date', $name, $value, $options); break; case 'select': $html .= \Form::select($name, $list, $value, $options); break; default: throw new FireflyException('Cannot handle type "' . $type . '" in FFFormBuilder.'); break; } /* * If errors, respond to them: */ if (!is_null($errors)) { if ($errors->has($name)) { $html .= ''; $html .= '

' . e($errors->first($name)) . '

'; } } unset($errors); /* * If warnings, respond to them: */ if (!is_null($warnings)) { if ($warnings->has($name)) { $html .= ''; $html .= '

' . e($warnings->first($name)) . '

'; } } unset($warnings); /* * If successes, respond to them: */ if (!is_null($successes)) { if ($successes->has($name)) { $html .= ''; $html .= '

' . e($successes->first($name)) . '

'; } } unset($successes); $html .= '
'; $html .= '
'; return $html; } }