Example #1
0
 /**
  * Construct.
  *
  * @param Button $button     Item button.
  * @param array  $attributes Html attributes.
  */
 public function __construct(Button $button, array $attributes = array())
 {
     $attributes = array_merge_recursive(array('role' => 'presenation'), $attributes);
     $button->removeClass('btn');
     $this->button = $button;
     parent::__construct($attributes);
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * Get the label.
  *
  * @return string
  */
 public function getLabel()
 {
     return $this->toggle->getLabel();
 }