Пример #1
0
 public function testMakeWithAttributes()
 {
     $icon = Icon::make($this->testIcon, $this->testAttributes);
     $this->assertTag($this->baseIconWithAttributes, $icon);
 }
Пример #2
0
 /**
  * Adds an icon to the next button
  *
  * @param string  $icon        The name of the icon to call
  * @param array   $attributes  Attributes to pass to the generated icon
  * @param boolean $prependIcon Whether we should prepend the icon, or append it
  *
  * @return object Button instance
  */
 public function with_icon($icon, $attributes = array(), $prependIcon = true)
 {
     // Call Icon to create the icon
     $icon = Icon::make($icon, $attributes);
     // If there was no text, just use the icon, else put a space between
     $value = $this->currentButton['value'];
     if (empty($value)) {
         $value = $icon;
     } else {
         $value = $prependIcon ? $icon . ' ' . $value : $value . ' ' . $icon;
     }
     // Store modified value
     $this->currentButton['value'] = $value;
     return $this;
 }