/** * Opens a new ButtonGroup section. * * @param string $toggle Whether the button group should be togglable * @param array $attributes An array of attributes * * @return string An opening <div> tag */ public static function open($toggle = null, $attributes = array()) { $validToggles = array(ButtonGroup::TOGGLE_CHECKBOX, ButtonGroup::TOGGLE_RADIO); if (isset($toggle) && in_array($toggle, $validToggles)) { $attributes['data-toggle'] = 'buttons-' . $toggle; } $attributes = Helpers::add_class($attributes, 'btn-group'); return '<div' . Helpers::getContainer('html')->attributes($attributes) . '>'; }
/** * Creates a table-wide row to display content * * @param string $content The content to display * @param array $attributes The rows's attributes * @param bool $asHeaders Draw row as header * * @return string A single-column row spanning all table */ protected function full_row($content, $attributes = array(), $asHeaders = false) { // Add a class for easy styling $attributes = Helpers::add_class($attributes, 'full-row'); $tag = $asHeaders ? 'th' : 'td'; return '<tr' . Helpers::getContainer('html')->attributes($attributes) . '> <' . $tag . ' colspan="' . $this->numberColumns . '">' . $content . '</' . $tag . '> </tr>'; }
/** * Create a text box with the search-query class. * * @param string $name name of the textbox * @param string $value value of textbox * @param array $attributes attributes for control * * @return string * @see Laravel\Form::text() */ public static function search_box($name, $value = null, $attributes = array()) { $attributes = Helpers::add_class($attributes, 'search-query'); return static::text($name, $value, $attributes); }