/** * Creates a DropdownButton. * * @param string $type * @param string $value * @param array $list * @param array $attributes * @param bool $right * @param bool $dropup * @param bool $autoroute * @return string */ protected static function show($type, $value, $list, $attributes = array(), $right = false, $dropup = false, $autoroute = true) { $attributes = Helpers::add_class($attributes, 'btn-group'); $list_attr = array(); if ($right) { $list_attr['class'] = 'pull-right'; } if ($dropup) { $attributes['class'] .= ' dropup'; } $html = '<div' . HTML::attributes($attributes) . '>'; $html .= Form::button($value, array('class' => $type), true); $html .= Navigation::dropdown($list, $list_attr, $autoroute); $html .= '</div>'; return $html; }
/** * Outputs the current Dropdown in instance * * @return string A Dropdown menu */ public function __toString() { // Base class $this->attributes = Helpers::add_class($this->attributes, 'btn-group'); // Pull right $listAttributes = $this->pullRight ? array('class' => 'pull-right') : array(); // Dropup if ($this->dropup) { $this->attributes['class'] .= ' dropup'; } $html = '<div' . HTML::attributes($this->attributes) . '>'; //If split is false make this button dropdown $html .= Form::button($this->label, array('class' => $this->type), !$this->split); //Add split button if needed if ($this->split) { $html .= Form::button('', array('class' => $this->type), true); } $html .= Navigation::dropdown($this->links, $listAttributes, $this->autoroute); $html .= '</div>'; return $html; }
/** * Create a button element. * * @param string $value * @param array $options * @return string * @static */ public static function button($value = null, $options = array()) { //Method inherited from \Illuminate\Html\FormBuilder return \Bootstrapper\Form::button($value, $options); }
public function testButton() { $html = Form::button('foo', $this->testAttributes); $matcher = $this->createButtonMatcher('button'); $this->assertTag($matcher, $html); }