コード例 #1
0
ファイル: FormTest.php プロジェクト: dyon/flatstrapper
 public function testActionBar()
 {
     $html = Form::actions(array(Button::primary_submit('Save changes'), Form::button('Cancel')));
     $matcher = array('tag' => 'div', 'attributes' => array('class' => 'form-actions'), 'child' => array('tag' => 'button', 'attributes' => array('class' => 'btn-primary btn', 'type' => 'submit'), 'content' => 'Save changes'), 'descendant' => array('tag' => 'button', 'attributes' => array('class' => 'btn', 'type' => 'button'), 'content' => 'Cancel'));
     $this->assertHTML($matcher, $html);
 }
コード例 #2
0
ファイル: ButtonTest.php プロジェクト: dyon/flatstrapper
 public function testMultipleButtons()
 {
     $buttons = Button::info('foo') . Button::success('foo');
     $matcher = '<button class="btn-info btn" type="button">foo</button><button class="btn-success btn" type="button">foo</button>';
     $this->assertEquals($matcher, $buttons);
 }
コード例 #3
0
ファイル: Form.php プロジェクト: dyon/flatstrapper
 /**
  * Create a HTML button element.
  * Overriding the default button to add the correct class from Laravel\Form
  *
  * @param string $value       text value of button
  * @param array  $attributes  array of attributes for button
  * @param bool   $hasDropdown button has dropdown
  *
  * @return string
  */
 public static function button($value = null, $attributes = array(), $hasDropdown = false)
 {
     return Button::normal($value, $attributes, $hasDropdown);
 }