public static function input(Html $input, BaseControl $control, $isPart) { $name = $input->getName(); if ($name === 'select' || $name === 'textarea' || $name === 'input' && !in_array($input->type, ['radio', 'checkbox', 'file', 'hidden', 'range', 'image', 'submit', 'reset'])) { $input->addClass('form-control'); } elseif ($name === 'input' && ($input->type === 'submit' || $input->type === 'reset')) { $input->setName('button'); $input->addHtml($input->value); $input->addClass('btn'); } return $input; }
/** * Configure hashtag button * * @param string $hashtag */ public function setHashtagButton($hashtag = NULL) { $this->element->addClass('twitter-hashtag-button'); // Build URL $url = new Url(self::TWITTER_TWEET_URL); $url->setQueryParameter('button_hashtag', $hashtag); $this->href = (string) $url; if ($hashtag) { $this->elementText = "Tweet #{$hashtag}"; } }