public function sendMessage($sendData) { $from = array('name' => Config::get('senderName'), 'email' => Config::get('senderEmail')); $to = Config::get('contactEmail'); $replyTo = array('name' => $sendData['name'], 'email' => $sendData['email']); $subject = 'Contact'; $body = View::render('content/email/vContactTpl', $sendData, TRUE); if (mailSend($from, $to, $replyTo, $subject, $body)) { Form::reset(); return array('success' => TRUE, 'result' => 'Your message has been sent.'); } else { return array('success' => FALSE, 'result' => 'An error occurred while sending.'); } }
?> </div> </div> <div class="section _100"> <?php echo Form::label('Table', 'table'); ?> <div> <?php echo Form::input('table', Input::post('table', isset($form) ? $form->table : ''), array('class' => 'required tableExists')); ?> </div> </div> </div> <!-- end content no-padding with-actions --> <div class="actions"> <div class="actions-left"> <?php echo Form::reset('reset', 'Reset', array('class' => 'over button color red small')); ?> </div> <div class="actions-right"> <?php echo Form::submit('submit', 'Save', array('class' => 'over button color green')); ?> </div> </div> <?php Form::close();
/** * @param array $params * @param Smarty_Internal_Template $smarty * * @return string * * @author Kovács Vince */ function smarty_function_form_reset($params, Smarty_Internal_Template &$smarty) { $value = isset($params['_value']) ? $params['_value'] : null; unset($params['_value']); return Form::reset(Lang::get($value), $params); }
echo Form::open_for_files('admin/newmedia', '', array('class' => 'form-stacked')); echo '<fieldset>'; echo '<legend>Add Media</legend>'; echo '<div class="clearfix">'; echo Form::label('image', 'Image'); echo '<div class="input">'; echo Form::file('image'); echo '</div>'; echo '</div>'; echo '<div class="clearfix">'; echo Form::label('caption', 'Caption'); echo '<div class="input">'; echo Form::text('caption', '', array('class' => 'span3')); echo '<span class="help-inline">'; echo 'Caption for image'; echo '</span>'; echo '</div>'; echo '</div>'; echo '<div class="clearfix">'; echo Form::label('meta', 'Meta'); echo '<div class="input">'; echo Form::text('meta', '', array('class' => 'span3')); echo '<span class="help-inline">'; echo 'Meta data for image'; echo '</span>'; echo '</div>'; echo '</div>'; echo Form::submit('Save', array('class' => 'btn primary')); echo Form::reset('Cancel', array('class' => 'btn')); echo '</fieldset>'; echo Form::close();
<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div> <div> <span class="btn btn-sm btn-primary btn-file"> <span class="fileinput-new">Select image</span> <span class="fileinput-exists">Change</span>' . Form::file($name) . '</span> <a href="javascript:void(0);" class="btn btn-sm btn-inverse fileinput-exists" data-dismiss="fileinput">Remove</a> </div> </div> </div> </div>'; return $formInput; }); Form::macro('bSubmit', function ($value = null, $parameters = array('class' => 'btn btn-sm btn-primary')) { return '<div class="form-group"> <div class="col-md-offset-2 col-md-10">' . Form::submit($value, $parameters) . '</div>' . '</div>'; }); Form::macro('bJsonSubmit', function ($value = null, $parameters = array('class' => 'btn btn-sm btn-primary')) { if (!isset($parameters['id'])) { $parameters['id'] = 'jsonSubmit'; } if (!isset($parameters['class'])) { $parameters['class'] = 'btn btn-sm btn-primary'; } return '<div class="form-group"> <div class="col-md-offset-2 col-md-10">' . Form::submit($value, $parameters) . '</div>' . '</div>'; }); Form::macro('bSubmitReset', function ($submitValue = 'Submit', $resetValue = 'Reset', $submitParameters = array('class' => 'btn btn-sm btn-primary'), $resetParameters = array('class' => 'btn btn-sm btn-inverse')) { return '<div class="form-group"> <div class="col-md-offset-2 col-md-10"> <div class="btn-group">' . Form::submit($submitValue, $submitParameters) . Form::reset($resetValue, $resetParameters) . '</div>' . '</div>' . '</div>'; });
/** * Test the compilation of form reset * * @group laravel */ public function testFormReset() { $form1 = Form::reset('foo'); $form2 = Form::reset('foo', array('class' => 'span2')); $this->assertEquals('<input type="reset" value="foo">', $form1); $this->assertEquals('<input class="span2" type="reset" value="foo">', $form2); }
'Mark 1:1', 'John 2:5-9' or 'Luke 1:1-4,6,9-10'. It can also take most commonly used abbreviations, such as '1 c 2:3' or 'jn 2'. </p> EOF; $translations = array('kjv' => 'King James Version', 'niv' => 'New International Version', 'nrsv' => 'New Revised Standard Version', 'amp' => 'Amplified Bible', 'cev' => 'Contemporary English Version', 'esv' => 'English Standard Version', 'mkjv' => 'Modern King James Version', 'msg' => 'The Message', 'nasb' => 'New American Standard Bible', 'nkjv' => 'New King James Version', 'nlt' => 'New Living Translation'); if ($_GET['translation']) { $translation = $_GET['translation']; } else { $translation = 'niv'; } require_once 'Form.class'; $form = new Form(); $form->text('Enter Bible Verse', 'verse', $_GET['verse']); $form->select('Select Translation', 'translation', $translations, $translation); $form->submit('submit', 'Search'); $form->reset('Clear'); $page->content .= $form->render(); if (isset($_GET['verse']) && $_GET['verse'] != '') { require_once 'Bible.class'; $bible = new Bible(); if ($bible->setTranslation($translation)) { $page->content .= "<h2>" . $translations[$translation] . "</h2>\n"; $page->content .= $bible->parseVerse($_GET['verse']); } else { $page->content .= "<h2>Unknown Translation</h2>\n"; $page->content .= "<p>Unknown translation: " . $translation . "</p>\n"; } unset($bible); } $page->display();