示例#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;
 }
示例#2
0
 /**
  * Set the label.
  *
  * @param string $label The label.
  *
  * @return $this
  */
 public function setLabel($label)
 {
     $this->toggle->setLabel($label);
     return $this;
 }