Make a new submenu item instance.

@param  string $title
@param  array  $attributes

@return \anlutro\Menu\Nodes\SubmenuNode
492531
public function makeSubmenu($title, array $attributes = array())
	{
		$collection = new static($this->builder, ['id' => StringUtils::slug($title)]);

		return new Nodes\SubmenuNode($title, $collection, $attributes);
	}
175543
public function setTitle(Title $title)
    {
        $this->attachment['title'] = $title;

        if ($title->hasLink()) {
            $this->attachment['title_link'] = $title->getLink();
        }

        return $this;
    }
869447
public static function create(string $title = null, string $subtitle = null, Image $art = null, Image $backgroundImage = null): self
    {
        $metadata = new self();

        $metadata->title           = $title;
        $metadata->subtitle        = $subtitle;
        $metadata->art             = $art;
        $metadata->backgroundImage = $backgroundImage;

        return $metadata;
    }
1072925
public function withAttributes(array $attributes = []): Element
    {
        $this->attributes = array_merge(
            $this->attributes,
            $attributes
        );

        return $this;
    }
505287
public function setTitle($title) {
		if (is_array($title) && empty($title)) {
			$this->title = new \stdClass;
		} else {
			$this->title = $title;
		}

		return $this;
	}
1082071
public static function createElement($tag = '', $attributes1 = [], $attributes2 = [])
    {
        $tag_object = parent::createElement($tag);
        $tag_object->setTag($tag);
        $attributes = $attributes1;
        if (!is_array($attributes1) && strlen($attributes1) > 0) {
            $tag_object->text($attributes1);
            $attributes = $attributes2;
        }
        if (is_array($attributes)) {
            foreach ($attributes as $name => $value) {
                if (method_exists($tag_object, $name)) {
                    if (!is_array($value)) {
                        $value = [$value];
                    }
                    call_user_func_array([$tag_object, $name], $value);
                }
            }
        }

        $tag_object->configDefaults($tag);

        return $tag_object;
    }
5553
public function setRightTitle($title)
    {
        foreach ($this->getChildren() as $field) {
            /** @var FormField $field */
            $field->setRightTitle($title);
        }

        return $this;
    }
290378
public function createElement(array $attributes)
    {
        $meta = $this->ownerDocument->createElement('meta');

        $name = null;
        foreach ($attributes as $key => $value) {
            $meta->setAttribute($key, $value);
        }

        $this[] = $meta;

        return $meta;
    }
325527
public function setTitle( $title )
	{
	    $this->title = $title;
		$this->jsWriter->setOption( 'title', $title );

		return $this;
	}
1316334
public function createLabel($textContent = null, array $attributes = [])
    {
        $label = new Form\Elements\Label($attributes);
        $label->attributes->addAttributeClass('col-form-label');

        if (isset($textContent)) {
            $label->textContent->push($textContent);
        }

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

        return $this->childNodes->last();
    }
187795
public function createHeader($text, $tagName = 'h1', array $attributes = ['class' => 'display-3'])
    {
        $header = new Element($tagName, 'header-' . dash($text));
        $header->textContent->push($text);

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $header->attributes->addAttribute($name, $value);
            }
        }

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

        return $this->childNodes->last();
    }
303933
public function findByTitleOrAdd(string $title, int $order = null, string $icon = null, array $attributes = [], callable $callback = null): ?MenuItem
    {
        if (! ($item = $this->findBy('title', $title, $callback))) {
            $item = $this->add(compact('title', 'order', 'icon', 'attributes'));
            ! is_callable($callback) || call_user_func($callback, $item);
        }

        return $item;
    }
88278
public function createItem($text, $href, $title = '')
    {
        $breadcrumb = new BreadcrumbObject();

        $breadcrumb->setText($text);
        $breadcrumb->setHref($href);

        if ($title) {
            $breadcrumb->setTitle($title);
        }

        $this->breadcrumbs[] = $breadcrumb;

        return $breadcrumb;
    }
1330697
public function createDropdownMenuItem(ItemInterface $rootItem, $title, $attributes = [], $caret = true)
    {
        // Add child to dropdown, still normal KnpMenu usage
        $options = array_merge(
            [
                'dropdown'           => true,
                'childrenAttributes' => [
                    'class' => 'vic-dropdown-menu',
                ],
                'attributes' => [
                    'class'       => 'vic-dropdown',
                    'data-toggle' => 'vic-dropdown',
                ],
                'linkAttributes' => [
                    'class'       => 'vic-dropdown-toggle',
                    'data-toggle' => 'vic-dropdown',
                ],
                'uri' => '#',
            ],
            $attributes
        );

        $menu = $rootItem->addChild($title, $options)->setExtra('caret', $caret);

        return $menu;
    }
260222
public function addSubItem($name, $title, $options = [])
    {
        $options           = is_array($options) ? $options : ['url' => $options];
        $options['parent'] = $this;

        return $this->menu->addItem($name, $title, $options);
    }
1218956
public function setTitle( $title ) {
		if ( $this->title !== $title ) {
			$this->title = $title;
			$this->updateTitle();
		}

		return $this;
	}
390563
public function dropdown($title, \Closure $callback, $order = null, array $attributes = array())
    {
        $properties = compact('title', 'order', 'attributes');

        if (func_num_args() == 3) {
            $arguments = func_get_args();

            $title = array_get($arguments, 0);
            $attributes = array_get($arguments, 2);

            $properties = compact('title', 'attributes');
        }

        $item = MenuItem::make($properties);

        call_user_func($callback, $item);

        $this->items[] = $item;

        return $item;
    }