Example #1
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 #2
0
 /**
  * @param $label
  */
 public function setLabel($label)
 {
     $this->toggle->setLabel($label);
 }