Example #1
0
 function it_can_be_given_contents_as_an_array(Form $form)
 {
     $form->label('first', 'First')->willReturn('label1');
     $form->checkbox('first', 'First')->willReturn('checkbox1');
     $form->label('second', 'Second')->willReturn('label2');
     $form->checkbox('second', 'Second')->willReturn('checkbox2');
     $this->withContents([['label' => ['first', 'First'], 'input' => ['type' => 'checkbox', 'first', 'First']], ['label' => ['second', 'Second'], 'input' => ['type' => 'checkbox', 'second', 'Second']]])->render()->shouldBe("<div class='form-group'>label1 checkbox1<br />label2 checkbox2<br /></div>");
 }
Example #2
0
 /**
  * Create a checkbox input field.
  *
  * @param string $name
  * @param mixed $value
  * @param bool $checked
  * @param array $options
  * @return string 
  * @static 
  */
 public static function checkbox($name, $value = 1, $checked = null, $options = array())
 {
     //Method inherited from \Illuminate\Html\FormBuilder
     return \Bootstrapper\Form::checkbox($name, $value, $checked, $options);
 }