Creates new menuitem and adds it to items list

@param string $name
Internal name of item
@param string $text
Text to show
@param string $url
Optional url for linking

@return MenuItem Reference to the created child item.
516695
public function &createItem($name, $text, $url = '')
    {
        $menu_item = new MenuItem();

        $menu_item->setName($name);
        $menu_item->setText($text);

        if ($url) {
            $menu_item->setUrl($url);
        }

        $this->items[$name] = $menu_item;

        return $this->items[$name];
    }
514340
public ParagraphBuilder link(final String text, final URL url) {
		final ParagraphElement paragraphElement = Link.create(text, url);
		this.paragraphElements.add(paragraphElement);
		return this;
	}
1111457
public function addBreadcrumbLinkUntranslated(string $name, string $link = null, array $arguments = []): Link
	{
		return $this['breadcrumb']->addLinkUntranslated($name, $link, $arguments);
	}
386910
function &addItem($content, $name = null) {
        if (!$name) {
            $name = uniqid(microtime(true), true);
        }
        $this->items[$name] = new Li($content);
        return $this->items[$name];
    }
227622
public function url($url, $title, $order = 0, $attributes = array())
    {
        if (func_num_args() == 3) {
            $arguments = func_get_args();

            return $this->add([
                'url' => $this->formatUrl(array_get($arguments, 0)),
                'title' => array_get($arguments, 1),
                'attributes' => array_get($arguments, 2)
            ]);
        }

        $url = $this->formatUrl($url);
        
        $item = MenuItem::make(compact('url', 'title', 'order', 'attributes'));

        $this->items[] = $item;

        return $item;
    }
568752
public function addWebButton($text, $url)
    {
        $this->add(new Button(Button::TYPE_WEB, $text, $url));

        return $this;
    }
409109
public function addAction($text, $url, $style = null)
    {
        $this->actions[] = [
            'type' => 'button',
            'text' => (string) $text,
            'url' => (string) $url,
            'style' => (string) $style,
        ];

        return $this;
    }
585645
function addItem($access_name, $text, $url) {
        Map::instance()
           ->add(
               $access_name, $text, $url
           );
        return $this;
    }
646942
public function linkIfCan($authorization, string $url, string $text)
    {
        return $this->addIfCan($authorization, Link::to($url, $text));
    }
309686
public function add_item($key, $title, moodle_url $url, $method) {
        if (isset($this->items[$key])) {
            throw new coding_exception('Menu item already exists');
        }
        if (empty($title) or empty($key)) {
            throw new coding_exception('Empty title or item key not allowed');
        }
        $item = new stdclass();
        $item->title = $title;
        $item->url = $url;
        $item->method = $method;
        $this->items[$key] = $item;
    }
1039300
public function createMenu($name, \Closure $allocation_callback = null)
    {
        // Create menu.
        if (empty($menu = $this->get($name))) {
            $menu = new Menu($name);
        }

        // Store the menu object.
        $this->menu_collection->put($name, $menu);

        // Make available in all views.
        app('view')->share($name, $menu);

        // Allocate menu items, if provided.
        if (is_callable($allocation_callback)) {
            $allocation_callback($menu);
        }

        return $menu;
    }
1273088
public function addBreadcrumbLink($name, $url = '', $icon = '')
    {
        $this->breadcrumbItems->push((object) ['name' => $name, 'url' => $url, 'icon' => $icon]);
    }
1075427
def create_image_menu_item(self, text, image_name):
        
        menu_item = Gtk.ImageMenuItem(text)
        img = self.create_image(image_name)
        menu_item.set_image(img)
        return menu_item
590136
public static Link create(final String text, final TextStyle ts, final URL url) {
		return new Link(text, ts, url.toString());
	}
1086725
public function addItem($name, $title, $options = [])
    {
        $options = is_string($options) ? ['url' => $options] : $options;
        $item    = new Item($this, $name, $title, $options);
        $this->items->addItem($item);

        return $item;
    }
24053
public function setUrl($name, $url, $oldUrl = null)
    {
        $this->arguments[] = 'set-url';
        $this->arguments[] = $name;
        $this->arguments[] = $url;
        if ($oldUrl) {
            $this->arguments[] = $oldUrl;
        }
        return $this;
    }
211129
public function menu($text, $uniqueKey, callable $runner)
    {
        $this->createCommand->create($uniqueKey, $text, $runner);
    }