Create a new button
@param string $label
@param string $url
@param string $status
@param string $icon
@param bool $block
@param bool $disabled
@param bool $flat
@param string $size
@return $this
960447
public function button(
            $label    = null,
            $url      = null,
            $status   = null,
            $icon     = null,
            $block    = false,
            $disabled = false,
            $flat     = false,
            $size     = Button::SIZE_NORMAL)
    {
        $button = new Button($label, $url, $status, $icon, $block, $disabled, $flat, $size);
        return $this->addButton($button);
    }
1363098
public function scope($key, $label = '')
    {
        return tap(new Scope($key, $label), function (Scope $scope) {
            return $this->scopes->push($scope);
        });
    }
1170829
public static function create(string $name, string $label = null): self
    {
        return new self($name, $label);
    }
1173752
public function addLink(
            string $label, 
            string $url, 
            bool $active       = false, 
            bool $disabled     = false, 
            string $icon       = null, 
            string $iconColor  = null, 
            string $badge      = null, 
            string $badgeColor = null)
    {
        Checkers::checkUrl($url);
        $this->items[] = [
            'label'    => $label, 
            'url'      => $url, 
            'active'   => $active, 
            'disabled' => $disabled,
            'icon'     => $icon,
            'icolor'   => $iconColor,
            'badge'    => $badge,
            'bcolor'   => $badgeColor
        ];
        return $this;
    }
1139546
public function attachLabel($label,$side=Side::TOP,$direction=Direction::NONE,$icon=NULL){
		$label=$this->addLabel($label,true,$icon);
		$label->setAttached($side,$direction);
		return $this;
	}
543088
public function addButtonOnly($label, $privilege, $controller, $action = 'index', array $other = array())
    {
        $other['button_only'] = true;

        return $this->addPage($label, $privilege, $controller, $action, $other);
    }
1255100
public function link($url, $label = null)
    {
        $url = $this->h($this->fullUrl($url));

        return '<a href="'.$url.'">'.($label ? $this->h($label) : $url).'</a>';
    }
569617
public function setLabel(Label $label)
    {
        $label->checkId();
        $label->setScriptEvents(true);
        $this->label = $label;
        return $this;
    }
300477
public static function appendLabel($uri, $label)
    {
        $host = new Host(self::filterUri($uri)->getHost());
        if ($host->isDomain()) {
            return $uri->withHost((string) (new Domain($host))->append($label));
        }

        if ($host->isIpv4()) {
            $label = ltrim((string) new Host($label), '.');

            return $uri->withHost((string) $host->withContent($host->getContent().'.'.$label));
        }

        throw new SyntaxError(sprintf('The URI host %s can not be appended', (string) $host));
    }
61748
public function addLabel($label, $before=false, $icon=NULL) {
		$this->tagName="div";$prefix="";
		if($before)
			$prefix="left ";
		$this->addToProperty("class", $prefix."labeled");
		$isIcon=(isset($this->content[0]) && $this->content[0] instanceof HtmlIcon);
		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
		if($isIcon){
			$this->content->addClass("icon");
		}
		$this->content->setTagName("div");
		$label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a");
		$label->setBasic();
		$this->addContent($label, $before);
		return $label;
	}
1042315
public function setLabel($label)
    {
        if (is_array($label) && $label['icon']) {
            $this->setIcon($label['icon']);
        } elseif (is_string($label)) {
            return $this->setText($label);
        }

        return $this;
    }
50071
public function setActionEdit(
        string $route = null,
        array $params = [],
        string $label = '',
        string $title = 'Edit',
        string $class = '',
        string $icon = 'fa fa-pencil'
    ): ButtonInterface {
        $this->setAction(self::TYPE_ACTION_EDIT)
            ->setRoute($route, $params)
            ->setLabel($label)
            ->setTitle($title)
            ->setClass($class)
            ->setIcon($icon);

        return $this;
    }
59589
public function addLabel($label, $before=false, $icon=NULL) {
		$this->tagName="div";
		$this->addToProperty("class", "labeled");
		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
		$this->content->setTagName("div");
		$label=new HtmlLabel("label-" . $this->identifier, $label, "a");
		if(isset($icon))
			$label->addIcon($icon);
		$label->setBasic();
		$this->addContent($label, $before);
		return $label;
	}
740205
public function createLink($label, $href = null, $position = self::NAVBAR_LEFT)
    {
        if ( ! is_object($label) && isset($href)) {
            $label = new Link($label, $href);
        }

        switch ($position) {
            default:
            case self::NAVBAR_LEFT:
                $node = $this->left->createList($label);
                break;

            case self::NAVBAR_RIGHT:
                $node = $this->right->createList($label);
                break;
        }

        return $node;
    }
450136
public function addButton($label, $meta = array())
    {
        $objButton = new Button($label, $meta);
        // *** Set the parent for the new field.
        $objButton->setMeta("parent", $this, true);

        $this->__fields->addObject($objButton);

        return $objButton;
    }
1080663
public function addItem(string $id, string $label, string $uri = null, string $icon = null, array $attributes = []): Menu
    {
        $attributes = Arr::except($attributes, ['label', 'uri']);

        $this->dispatcher->dispatch(new ItemAdding($id, $this->generateMenuItem($this->menuItem)));

        if ($icon && Str::startsWith($icon, 'zmdi-')) {
            $icon = 'zmdi ' . $icon;
        }
        if ($icon && !app('antares.request')->shouldMakeApiResponse()) {
            $label = sprintf('<i class="%s"></i> %s', $icon, $label);
        }

        $item = $this->menuItem->addChild($id, array_merge($attributes, [
            'label' => $label,
            'uri'   => $uri,
            'icon'  => $icon,
        ]));
        $item->setAttributes(array_merge($attributes, ['icon' => $icon]));

        $item->setExtra('safe_label', true);

        $this->dispatcher->dispatch(new ItemAdded($id, $this->generateMenuItem($this->menuItem)));

        return $this;
    }
916911
public function set_action(moodle_url $url, $label) {
        $this->actionurl    = $url;
        $this->actionlabel  = $label;
    }