Add a form layout section to this layout.

Each section may contain other section or group.

@param mixed $seed
@param bool  $addDivider Should we add divider after this section

@throws \atk4\core\Exception
@throws \atk4\ui\Exception

@return static
971107
public function addSubLayout($seed = 'Generic', $addDivider = true)
    {
        $v = $this->add($this->factory($seed, ['form' => $this->form], 'FormLayout/Section'));
        if ($v instanceof \atk4\ui\FormLayout\Section\Generic) {
            $v = $v->addSection();
        }

        if ($addDivider) {
            $this->add(['ui' => 'hidden divider']);
        }

        return $v;
    }
68065
public function addSection(NavigationSectionInterface $section, $priority = 1)
    {
        intval($priority);
        while (isset($this->sections[$priority])) {
            $priority++;
        }

        $this->sections[$priority] = $section;
        $section->setRootSection($this);

        return $section;
    }
30806
public function setSeed($seed)
    {
        if (is_int($seed) !== true) {
            throw new Exception(
                sprintf('The type of the seed value "%s" need to be int. You passed a(n) "%s".', $seed, gettype($seed))
            );
        }

        // We need to call different methods depending on chosen source
        switch ($this->getMode()) {

            case self::MODE_PHP_MERSENNE_TWISTER:
                mt_srand($seed);
                break;

            case self::MODE_PHP_DEFAULT:
                srand($seed);
                break;

            case self::MODE_OPEN_SSL:
            default:
                // Intentionally left blank
                break;
        }

        $this->seed = $seed;
    }
101405
public function addSection( $section )
	{
		if ( !( isset( $this->data[$section] ) && is_array( $this->data[$section] ) ) )
			$this->data[$section]	= array();
		$this->currentSection	= $section;
	}
371430
public function initLayout($seed)
    {
        $layout = $this->factory($seed, null, 'Layout');
        $layout->app = $this;

        if (!$this->html) {
            $this->html = new View(['defaultTemplate' => 'html.html']);
            $this->html->app = $this;
            $this->html->init();
        }

        $this->layout = $this->html->add($layout);

        $this->initIncludes();

        return $this;
    }
201852
public function setGuessedColumnFormatters($seeding)
    {
        $this->guessedFormatters = $this->getGuessedColumnFormatters($this->model, $seeding, true);

        if ($this->dimsavTranslatable()) {
            $this->guessDimsavFormatters($seeding);
        } else {
            $this->guessMultilingualFormatters();
        }

        $this->setGuessedPivotFormatters($seeding);
    }
169935
private function addSegment(string $segment): void
    {
        preg_match_all(
            "/\{(?'name'[a-z0-9_]++)(?::(?'pattern'(?:[^{}]++|\{(?&pattern)\})++))?\}/i",
            $segment,
            $matches,
            \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE | \PREG_UNMATCHED_AS_NULL
        );

        if (empty($matches)) {
            $this->segments[] = $segment;
            $this->format .= $this->formatEncode($segment) . '/';
            return;
        }

        $pattern = $this->formatPattern($segment, $matches);
        $this->patterns[\count($this->segments)] = sprintf('/%s/', $pattern);
        $this->segments[] = self::DYNAMIC_SEGMENT;
    }
859532
public function addField($fieldName, $getMethod, $setMethod, ByConfigBuilder $include = null, $formatter = null)
    {
        if (method_exists($this->getEntityPrototype(), $getMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $getMethod, $this->entityClassName), 2);
        }

        if (method_exists($this->getEntityPrototype(), $setMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $setMethod, $this->entityClassName), 2);
        }

        $this->mapping[$fieldName] = array(
            'getter'    => $getMethod,
            'setter'    => $setMethod,
            'include'   => $include,
            'formatter' => $formatter,
        );

        return $this;
    }
628090
public function addCell($width, $style = null) {
		$cell = new PHPWord_Section_Table_Cell($this->_insideOf, $this->_pCount, $width, $style);
		$i = count($this->_rows) - 1;
		$this->_rows[$i][] = $cell;
		return $cell;
	}
66571
private function setUpLayout()
    {
        if (Layout::filename()) {
            return;
        }

        Layout::filename('layout' . $this->divisionPostfix . '.php');

        Layout::addJsMgr('layout' . ($this->_division === '' ? '' : '_' . $this->_division));
        Layout::addCss('layout' . $this->divisionPostfix . '.css');

        $fileBaseName = $this->_module . '_' . $this->_method;
        // add default js manager
        $jsPath   = $this->divisionPath . '/js/managers/';
        $jsName   = $this->divisionPrefix . $fileBaseName;
        $fileName = MODULES . $jsPath . $jsName . '_mgr.js';
        if (file_exists($fileName)) {
            Layout::addJsMgr($jsName, MOD . $jsPath);
        }

        // add default css
        $cssPath  = $this->divisionPath . '/css/';
        $cssName  = $this->divisionPrefix . $fileBaseName . '.css';
        $fileName = MODULES . $cssPath . $cssName;
        if (file_exists($fileName)) {
            Layout::addCss($cssName, MOD . $cssPath);
        }
    }
293161
public function addSection($name, Section $parent = null, $priority = 1)
    {
        if (is_null($parent)) {
            $parent = $this->getRootSection();
        }

        $section = new Section($this, [
            'name'     => $name,
            'priority' => $priority,
        ]);

        $parent->addPage($section);

        return $section;
    }
303883
public function addSection(IniSection $section)
    {
        if ($this->hasSection($section->getName()))
        {
            throw new InvalidDataException(sprintf('Section "%s" already exists!',
                                                   $section->getName()));
        }

        if ($section->hasParent())
        {
            if (!isset($this->sections[$section->getParent()->getName()]))
            {
                throw new InvalidDataException(sprintf('Parent section "%s" does not exists!',
                                                       $section->getParent()->getName()));
            }
        }

        $this->sections[$section->getName()] = $section;

        return $this;
    }
608043
public function addSections() {
		foreach ($this->sectionBuffers as $section => $filePaths) {
			$this->add('# '.$section, 1, 1);
			foreach ($filePaths as $filePath => $tests) {
				$this->add('#### '.$filePath, 0, 1);
				foreach ($tests as $test => $lines) {
					$this->add('* '.$test, 0, 1);
					foreach ($lines as $line) {
						$this->add(" * Line {$line[0]}: `".str_replace('`', '\`', $line[1])."`", 0, 1);
					}
				}
				$this->add('', 1, 0);
			}
		}
	}
987280
public function addLayout($id, $content, array $attributes = [])
    {
        $namespaceLayoutId = $this->getLayoutNameWithNamespace($id);
        $this->layouts[$namespaceLayoutId] = [$id, $content, $attributes];
    }
907239
public void setDivider(final boolean divider) {
        if (divider)
            attrMixin.setAttribute(DIVIDER, Boolean.toString(true));
        else
            attrMixin.removeAttribute(DIVIDER);
    }
1115618
public function addLayoutDir($new_dir, $position = 0)
    {
        if (true === file_exists($new_dir) && true === is_dir($new_dir)) {
            $this->insertInArrayOnPostion($this->_layoutdir, $new_dir, $position);
        }

        return $this;
    }
951336
public static function addFormatterFolder($folder)
    {
        if (! is_dir($folder)) {
            return;
        }

        array_unshift(self::$formatterDirectories, $folder);
        self::$list = null;
    }