Base::createLink

@param string      $label
@param string|null $href

@return Item
5873
public function createLink($label, $href = null)
    {
        $link = new Link($label, $href);
        $link->attributes->addAttributeClass('nav-link');

        return $this->createList($link);
    }
894734
public function createList($label = '')
    {
        $returnValue = null;

        
        
        if(empty($label)) {
        	$label = __('List') . ' ' . (count($this->getLists()) + 1);
        }
        $returnValue = $this->createSubClass($this->parentListClass, $label);
        
        

        return $returnValue;
    }
396078
protected function createPageLink($label, $page, $disabled, $active)
    {
        return array(
            'label' => $label,
            'url' => $this->createPageUrl($page),
            'disabled' => $disabled,
            'active' => $active,
        );
    }
509572
public static function set_links( Base $entity, $link, Container $new = null )
    {

        $repository = $entity->r();
        if( !$repository->hasLink( $link, $detail ) ) {
            throw new EntityLinkException("Bad link `{$link}`");
        }

        if( is_null( $new ) ) {
            $new = new Container();
        }

        // check container is of the correct type
        $class = $new->classGet();
        $classUnqualified = get_unqualified_class( $class );
        if( $class and !in_array( $classUnqualified, $detail->foreignEntities ) ) {
            $foreignEntities = implode( ', ', $detail->foreignEntities );
            throw new EntityLinkException(
                "Passed container is of type `{$classUnqualified}` and we need one of type(s) {$foreignEntities}"
            );
        }

        // Build array key'd, $existing, like so
        // array(
        //     spl_obj_hash( 'link' ) => spl_obj_hash( 'entity' )
        // )

        $existingLinks = $repository->linksGet( $entity, $link, $classUnqualified, null, false );

        $existing = array();
        foreach( $existingLinks as $splHashLink => $link ) {
            $existing[$splHashLink] = spl_object_hash( $link[$detail->refForeign[0]] );
        }

        $newKeys = array_keys( $new->collection );

        $newKeys = array();
        $ordering = array(); $n = 0;
        foreach( $new as $splHashEntity => $_ ) {
            $newKeys[] = $splHashEntity;
            $ordering[$splHashEntity] = $n++;
        }

        // operations
        $toRemove = array_diff( $existing, $newKeys );
        $toAdd = array_diff( $newKeys, $existing );
        $unchanged = array_intersect( $existing, $newKeys );

        //
        $numModified = 0;

        // remove
        while( list($splHashLink,) = each( $toRemove ) ) {
            $existingLinks[$splHashLink][$detail->refSource[1]] = null;
            $existingLinks[$splHashLink][$detail->refForeign[0]] = null;
            $numModified++;
        }

        // add
        $linkRepo = Repository::init( $link );
        foreach( $toAdd as $key ) {

            $link = $linkRepo->make();
            $link[$detail->refSource[1]] = $entity;
            $link[$detail->refForeign[0]] = $new[$key];

            if( isset( $detail->sortColumn ) ) {
                $link[$detail->sortColumn] = $ordering[$key];
            }

            $numModified++;

        }

        if( isset( $detail->sortColumn ) ) {
            foreach( $unchanged as $linkKey => $entityKey ) {
                $numModified += $existingLinks[$linkKey]->set( $detail->sortColumn, $ordering[$entityKey] ) ? 1 : 0;
            }
        }

        return $numModified;

    }
1214727
public function link($location, $label = '[link]')
    {
        if ((string) $location === '') {
            return '';
        }

        if (Html::isURL($location)) {
            $location = Html::addScheme($location);
        } elseif ($record = $this->em->getContent($location)) {
            $location = $record->link();
        }

        return sprintf('<a href="%s">%s</a>', $location, $label);
    }
34474
public static function create(string $href): LinkBuilderInterface
    {
        $self = new self();
        $self->href = $href;
        $self->rels = [];
        $self->attributes = [];

        return $self;
    }
236896
public function setLabel($label, $domain = null)
    {
        $this->label = $label;
        $this->setDomain($domain);

        return $this;
    }
940279
public function createNode($parentKey, $key, $label, $value, $count, $selected)
    {
        /** @var $parentNode Node|null */
        $parentNode = isset($this->nodesByKey[$parentKey]) ? $this->nodesByKey[$parentKey] : null;
        $node = new Node($this, $parentNode, $key, $label, $value, $count, $selected);
        $this->nodesByKey[$key] = $node;

        if ($parentNode === null) {
            $this->addChildNode($node);
        } else {
            $parentNode->addChildNode($node);
        }

        $this->allNodes->add($node);
    }
530879
public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] )
    {
        $c = new Column\Button($name, $label, $link, $binds, $attr);
        $c->setOptionAsDefault();
        $this->addColumn($c);

        return $c;
    }
485272
public function setLabel($label) {
        if (!is_string($label)) throw new IllegalTypeException('Illegal type of parameter $label: '.gettype($label));
        if (!strlen($label))    throw new InvalidArgumentException('Invalid argument $label: '.$label);

        $this->label = $label;
        return $this;
    }
610248
public function createButton($label)
    {
        $node = new Button();

        if ($label instanceof Button) {
            $node = $label;
        } elseif ($label instanceof Dropdown) {
            $node = clone $label;
            $node->attributes->removeAttributeClass('dropdown');
            $node->attributes->addAttributeClass('btn-group');
            $node->attributes->addAttribute('role', 'group');

            $node->childNodes->push($label->toggle);
            $node->childNodes->push($label->menu);
        } else {
            $node->setLabel($label);
            if (is_numeric($label)) {
                $node->entity->setEntityName('button-' . $label);
            } else {
                $node->entity->setEntityName($label);
            }
        }

        $this->childNodes->push($node);

        return $this->childNodes->last();
    }
178620
public function setLabel( $label ) {
		$this->labelValue = (string)$label !== '' ? $label : null;

		$this->label->clearContent();
		if ( $this->labelValue !== null ) {
			if ( is_string( $this->labelValue ) && trim( $this->labelValue ) === '' ) {
				$this->label->appendContent( new HtmlSnippet( '&nbsp;' ) );
			} else {
				$this->label->appendContent( $label );
			}
		}

		$visibleLabel = $this->labelValue !== null && !$this->invisibleLabel;
		$this->toggleClasses( [ 'oo-ui-labelElement' ], $visibleLabel );

		return $this;
	}
622641
public static function navbarBrandLink($label, $url, $htmlOptions = array())
    {
        self::addCssClass('navbar-brand', $htmlOptions);
        return self::link($label, $url, $htmlOptions);
    }
1077945
public static function add($label, $urlCode = null, $addedArgs = array())
  {
    self::$items[] = new BreadcrumbItem($label, $urlCode, $addedArgs);
  }
157600
public function setLabel(string $label = null): ButtonInterface
    {
        if ($this->isVisibility()) {
            $this->label = $label;
        }

        return $this;
    }
987035
public function addLink($label, $uri, $additionalInfo = []) {
        if(is_string($label) && !empty(trim($label)) && is_string($uri) && is_array($additionalInfo)){
            $linkInfo[0] = array_intersect_key($additionalInfo, array_flip($this->allowedElements));
            $linkInfo[0]['uri'] = $uri;
            $linkInfo[0]['label'] = $label;
        }
        else{
            throw new InvalidArgumentException(
               'Link must contain a valid string for $label and $uri, additional information must be sent as an array'
            );
        }
        return $this->addLinks($linkInfo);
    }
661338
public function resetLink($label, array $options = [])
    {
        return $this->Html->link($label, $this->resetUrl(), $options);
    }