/** * @param Button $button * @param array $attributes */ function __construct(Button $button, array $attributes = array()) { $attributes = array_merge_recursive(array('role' => 'presenation'), $attributes); $button->removeClass('btn'); $this->button = $button; parent::__construct($attributes); }
/** * Create a button. * * @param string $label Button label. * @param string $url Button href url. * @param array $attributes Additional html attributes. * @param bool $fromFieldset Set true if attributes comes from fieldset definitions have to be transformed. * * @return Button */ public static function createButton($label, $url, array $attributes = array(), $fromFieldset = false) { $button = new Button(); $button->setLabel($label); static::applyAttributes($button, $attributes, $fromFieldset); $button->setAttribute('href', $url); return $button; }
/** * @return mixed */ public function getLabel() { return $this->toggle->getLabel(); }