Add a group, all items (api or route) must be child items of a group. The group is the title in the left menu of the admin interface.

@param string $name The name of the group.
@return \luya\admin\components\AdminMenuBuilder
333566
public function group($name)
    {
        $this->_pointers['group'] = $name;
        $this->_menu[$this->_pointers['node']]['groups'][$name] = ['name' => $name, 'items' => []];
    
        return $this;
    }
142132
private function getGroupIdByName(string $name)
    {
        if (!isset($this->groups)) {
            $this->resetCraftFieldsServiceGroupsCache();

            $this->groups = [];
            foreach (Craft::$app->fields->getAllGroups() as $group) {
                $this->groups[$group->name] = $group->id;
            }
        }
        if (!array_key_exists($name, $this->groups)) {
            $group = new FieldGroup(['name' => $name]);
            if (Craft::$app->fields->saveGroup($group)) {
                $this->groups[$name] = $group->id;
            } else {
                return Schematic::importError($group, $name);
            }
        }

        return $this->groups[$name];
    }
98362
public static function group($Name, $Options=null)
    {
        $instance = FirePHP::getInstance(true);
        return $instance->group($Name, $Options);
    }
805078
final public function add(string $name, $path): RouteConfigurator
    {
        $paths = [];
        $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);

        if (\is_array($path)) {
            if (null === $this->prefixes) {
                $paths = $path;
            } elseif ($missing = array_diff_key($this->prefixes, $path)) {
                throw new \LogicException(sprintf('Route "%s" is missing routes for locale(s) "%s".', $name, implode('", "', array_keys($missing))));
            } else {
                foreach ($path as $locale => $localePath) {
                    if (!isset($this->prefixes[$locale])) {
                        throw new \LogicException(sprintf('Route "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $name, $locale));
                    }

                    $paths[$locale] = $this->prefixes[$locale].$localePath;
                }
            }
        } elseif (null !== $this->prefixes) {
            foreach ($this->prefixes as $locale => $prefix) {
                $paths[$locale] = $prefix.$path;
            }
        } else {
            $this->collection->add($this->name.$name, $route = $this->createRoute($path));

            return new RouteConfigurator($this->collection, $route, $this->name, $parentConfigurator, $this->prefixes);
        }

        $routes = new RouteCollection();

        foreach ($paths as $locale => $path) {
            $routes->add($name.'.'.$locale, $route = $this->createRoute($path));
            $this->collection->add($this->name.$name.'.'.$locale, $route);
            $route->setDefault('_locale', $locale);
            $route->setDefault('_canonical_route', $this->name.$name);
        }

        return new RouteConfigurator($this->collection, $routes, $this->name, $parentConfigurator, $this->prefixes);
    }
718840
public function addGroup($title)
    {
        $group = $this->add([new self(), 'defaultTemplate' => 'menugroup.html', 'ui' => false]);
        if (is_string($title)) {
            $group->set('title', $title);
        } else {
            if (isset($title['icon']) && $title['icon']) {
                $group->add(new Icon($title['icon']), 'Icon')->removeClass('item');
            }
            $group->set('title', $title[0]);
        }

        return $group;
    }
1016532
public function actionView($name)
    {
        $formModel = new AddAuthItemForm();

        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        if (isset($_POST['AddAuthItemForm'])) {
            $formModel->attributes = $_POST['AddAuthItemForm'];
            if ($formModel->validate()) {
                if (!$am->hasItemChild($name, $formModel->items)) {
                    $am->addItemChild($name, $formModel->items);
                    if ($am instanceof CPhpAuthManager) {
                        $am->save();
                    }
                }
            }
        }

        $item = $am->getAuthItem($name);

        $dpConfig = array(
            'pagination' => false,
            'sort' => array('defaultOrder' => 'depth asc'),
        );

        $ancestors = $am->getAncestors($name);
        $ancestorDp = new PermissionDataProvider(array_values($ancestors), $dpConfig);

        $descendants = $am->getDescendants($name);
        $descendantDp = new PermissionDataProvider(array_values($descendants), $dpConfig);

        $childOptions = $this->getItemChildOptions($item->name);
        if (!empty($childOptions)) {
            $childOptions = array_merge(array('' => Yii::t('AuthModule.main', 'Select item') . ' ...'), $childOptions);
        }

        $this->render(
            'view',
            array(
                'item' => $item,
                'ancestorDp' => $ancestorDp,
                'descendantDp' => $descendantDp,
                'formModel' => $formModel,
                'childOptions' => $childOptions,
            )
        );
    }
90453
public function add($name)
    {
        $this->repository->setCurrentUser($this->repository->getUserService()->loadUser($this->adminID));
        $contentTypeService = $this->repository->getContentTypeService();

        $contentTypeGroupStruct = $contentTypeService->newContentTypeGroupCreateStruct($name);

        try {
            $contentTypeGroup = $contentTypeService->createContentTypeGroup($contentTypeGroupStruct);
            return $contentTypeGroup;
        } catch (UnauthorizedException $e) {
            throw new \RuntimeException($e->getMessage());
        } catch (InvalidArgumentException $e) {
            throw new \RuntimeException($e->getMessage());
        }
    }
909442
public function addName($name)
    {
        if (!in_array('names', $this->setFields)) {
            $this->setFields[] = 'names';
        }
        $this->names[] = $name;

        return $this;
    }
1344233
public function group($Name, $Options = null)
    {
    
        if (!$Name) {
            throw $this->newException('You must specify a label for the group!');
        }
        
        if ($Options) {
            if (!is_array($Options)) {
                throw $this->newException('Options must be defined as an array!');
            }
            if (array_key_exists('Collapsed', $Options)) {
                $Options['Collapsed'] = ($Options['Collapsed'])?'true':'false';
            }
        }
        
        return $this->fb(null, $Name, FirePHP::GROUP_START, $Options);
    }
1069652
public function addFolder($name)
    {
        $path = $this->details->getRealPath();
        return new Folder(
            array(
                'name' => $path .'/'. ltrim($name, '/')
            )
        );
    }
715280
public function createChildDirectory($name)
    {
        if (
            strpos($name, '\\') !== false
            || strpos($name, '/') !== false
            || strpos($name, '..') !== false
        ) {
            throw new InvalidArgumentException("Wrong folder name {$name}");
        }

        return new self($this->absolutePath . '/' . $name, $this->fileClass);
    }
848223
public function createRoute(Group $group, $name, array $parameters)
	{
		return $this->create('route', array($group, $name, $parameters));
	}
914799
public function addName(Name $name)
    {
        $names = array_map('strval', $this->names->toArray());
        if (!in_array($name->getName(), $names)) {
            $this->names->add($name);
            $name->setItem($this);
        }

        return $this;
    }
49847
public function setName($name) {
    /** @var TokenNode $function_name */
    $function_name = $this->getName()->firstChild();
    $function_name->setText($name);
    return $this;
  }
1185979
public function menu($name = 'default')
    {
        if (!isset($this->menus[$name])) {
            $this->menus[$name] = new Menu($this);
        }

        return $this->menus[$name];
    }
1067136
public function subMenu($key = null, $menuItem = null)
    {
        if (null === $menuItem) {
            return $this->subMenu;
        }

        if (is_callable($menuItem)) {
            $menu = new AdminMenu($menuItem);
            $this->subMenu[$key] = $menu;
        } else {
            $this->subMenu[$key] = $menuItem;
        }

        return $this;
    }
1241621
private function addBasicProviderNode($name)
    {
        $builder = new TreeBuilder($name);
        $node    = $this->getRootNode($builder, $name);

        return $node;
    }