Generation method
@return string
19054
public function toString()
    {
        $string = '';
        if (!empty($this->tag)) {
            $string .=  '<' . $this->tag;
            $string .= $this->attributesToString();
            if ($this->autoclosed) {
                $string .= '/>';
            } else {
                $string .= '>' . $this->contentToString() . '</' . $this->tag . '>';
            }
        } else {
            $string .= $this->text;
            $string .= $this->contentToString();
        }
        return $string;
    }
1053750
public function generate()
	{
		if ($this->imageSubmit)
		{
			$objModel = \FilesModel::findByPk($this->singleSRC);

			if ($objModel !== null && is_file(TL_ROOT . '/' . $objModel->path))
			{
				return sprintf('<button type="submit" id="ctrl_%s" class="submit btn %s" title="%s" alt="%s"%s>%s</button>',
					$this->strId,
					(($this->strClass != '') ? ' ' . $this->strClass : 'btn-default'),
					specialchars($this->slabel),
					specialchars($this->slabel),
					$this->getAttributes(),
					\Image::getHtml($objModel->path, $this->slabel)
				);
			}
		}

		$label = specialchars($this->slabel);

		if($this->bootstrap_addIcon) {
			$icon = Icons::generateIcon($this->bootstrap_icon);

			if($this->bootstrap_iconPosition == 'right') {
				$label = $label . ' ' . $icon;
			}
			else {
				$label = $icon  . ' ' . $label;
			}
		}

		// Return the regular button
		return sprintf('<button type="submit" id="ctrl_%s" class="submit btn %s"%s>%s</button>',
			$this->strId,
			(($this->strClass != '') ? $this->strClass : 'btn-default'),
			$this->getAttributes(),
			$label
		);
	}
1057984
public static function generate()
    {
        if (class_exists('O2System\Filesystem\System')) {
            $system = new \O2System\Filesystem\System();

            $metadata = [
                'machine'         => $system->getMachine(),
                'operatingSystem' => [
                    'name'    => $system->getName(),
                    'version' => $system->getVersion(),
                    'release' => $system->getRelease(),
                ],
                'hostname'        => $system->getHostname(),
                'cpuCores'        => $system->getCpuCores(),
                'macAddress'      => $system->getMacAddress(),
            ];
        } else {
            $metadata = [
                'machine'         => php_uname('m'),
                'operatingSystem' => [
                    'name'    => php_uname('s'),
                    'version' => php_uname('v'),
                    'release' => php_uname('r'),
                ],
                'hostname'        => php_uname('n'),
                'cpuCores'        => 1,
                'macAddress'      => implode(':', str_split(substr(md5('none'), 0, 12), 2)),
            ];
        }

        $uri = new Uri();

        $metadata[ 'domain' ] = $uri->getHost();
        $metadata[ 'ipAddress' ] = $_SERVER[ 'SERVER_ADDR' ];

        $string = json_encode($metadata);
        $string = md5($string);

        // Converts to UUID (Universally Unique Identifier)
        $parts[] = substr($string, 0, 8);
        $parts[] = substr($string, 8, 4);
        $parts[] = substr($string, 12, 4);
        $parts[] = substr($string, 16, 4);
        $parts[] = substr($string, 20, 12);

        $parts = array_map('strtoupper', $parts);

        return implode('-', $parts);
    }
1288909
protected function generateNumeric()
    {
        if (is_null($this->size) && $this->pattern == static::DEFAULT_PATTERN) {
            return $this->generateInteger();
        }

        return $this->generateString($this->getNumericGenerator());
    }
937707
public function generate()
    {
        $saved = $this->factoryMuffin->isPendingOrSaved($this->model);

        return call_user_func($this->kind, $this->model, $saved);
    }
659713
public function generate()
    {
        $chars = $this->validChars();
        $numChars = strlen($chars) - 1;
        $length = $this->getLength();
        $code = array();
        for ($i = 0; $i < $length; ++$i) {
            $code[] = $chars[random_int(0, $numChars)];
        }

        return implode('', $code);
    }
948905
public function generateFile()
    {
        parent::generateFile();

        if (count($this->uses) > 0) {
            sort($this->uses);
            $uses = '';
            foreach ($this->uses as $use) {
                $uses .= 'use ' . $use . ';' . $this->getNewlineCharacter();
            }
            $this->file_content = str_replace('{{ uses }}', $uses, $this->file_content);
        } else {
            $this->file_content = str_replace('{{ uses }}', '', $this->file_content);
        }
        $this->file_content = str_replace('{{ className }}', $this->class_name, $this->file_content);

        return $this->file_content;
    }
107259
public function generate()
	{
		if (TL_MODE === 'BE') {
			return parent::generate();
		}

		$parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
		if (isset($GLOBALS['TL_RS_COLUMNS'][$parentKey]) && !$GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
			$GLOBALS['TL_RS_COLUMNS'][$parentKey]['active'] = true;
		}
		else {
			trigger_error('Missing column start element before column stop element ID ' . $this->id . '.', E_USER_WARNING);
		}

		return parent::generate();
	}
197593
public function generate()
    {
        $businessEntities = $this->businessEntityHelper->getBusinessEntities();
        $skeletonDirs = $this->fileLocator->locate('@VictoireCoreBundle/CacheWarmer/skeleton/');
        $this->setSkeletonDirs($skeletonDirs);

        return $this->render('EntityProxy.php.twig', ['businessEntities' => $businessEntities]);
    }
1146098
public function generate()
    {
        $indentation = $this->getIndentation();

        $docLines = array();

        $docLines[] = $indentation . '/**';
        $spaceBeforeAnnotation = false;

        if ($this->shortDescription !== null) {
            $docLines[] = $indentation . ' * ' . $this->shortDescription;
            $spaceBeforeAnnotation = true;
        }

        if ($this->shortDescription !== null && $this->longDescription !== null) {
            $docLines[] = $indentation . ' *';
        }

        if ($this->longDescription !== null) {
            $description = preg_split('/\n|\r/', $this->longDescription, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($description as $desc) {
                $docLines[] = $indentation . ' * ' . trim($desc);
            }

            $spaceBeforeAnnotation = true;
        }

        $this->annotationGenerator->setIndentationLevel($this->getIndentationLevel());
        $this->annotationGenerator->setIndentationString($this->getIndentationString());
        $annotations = $this->annotationGenerator->generate();
        if ($annotations !== '') {
            if ($spaceBeforeAnnotation === true) {
                $docLines[] = $indentation . ' *';
            }

            $docLines[] = $annotations;
        }

        $docLines[] = $indentation . ' */';

        return implode($this->getLineFeed(), $docLines);
    }
825992
public function generate()
    {
        if (feof($this->h))
            rewind($this->h);

        return (float) fgets($this->h);
    }
1337759
public function generate()
    {
        $generator = $this->generator;
        $data = $this->data;

        $fgm = new FileGeneratorManager();
        $fm = new FileManager();
        $tm = new TemplateManager();
        $dbm = new DataBuilderManager();

        $result = $dbm->build($generator->data_builder, $data);

        if (!$result->ok()) {
            return $result;
        }

        // Overwrite filename if driver is local
        $diskName = Config::get('medialibrary.disk_name');

        if (Config::get("filesystems.disks.$diskName.driver", 'local') === 'local') {
            $generator->filename = bin2hex(random_bytes(32)).'-'.$generator->filename;
        }

        $data = $result->getResource();
        $result = $fgm->render($generator->data_builder, $generator->filetype, [
            'body'     => $generator->body,
            'filename' => sys_get_temp_dir().'/'.$generator->filename,
        ], $data);

        $bag = new Bag($result->getResource());

        file_put_contents($bag->get('filename'), $bag->get('body'));

        $result = $fm->create([]);
        $resource = $result->getResource();

        $resource
            ->addMedia($bag->get('filename'))
            ->addCustomHeaders([
                'ContentDisposition' => 'attachment; filename='.basename($bag->get('filename')).'',
            ])
            ->toMediaCollection('file');

        return $result;
    }
690657
public function generate()
    {
        $result = '';

        $table  = $this->buildTable();
        $select = $this->buildSelectFields();
        $where  = $this->buildWhere();
        $having = $this->buildHaving();
        $join   = $this->buildJoin();
        $limit  = $this->buildLimit();
        $group  = $this->buildGroup();
        $union  = $this->buildUnion();
        $order  = $this->buildOrder();

        $result .= 'SELECT '.$select.' FROM '.$table;
        if ($join != '') {
            $result .= ' '.$join;
        }
        if ($where != '') {
            $result .= ' '.$where;
        }
        if ($group != '') {
            $result .= ' '.$group;
        }
        if ($order != '') {
            $result .= ' '.$order;
        }
        if ($limit != '') {
            $result .= ' '.$limit;
        }
        if ($having != '') {
            $result .= ' '.$having;
        }
        if ($union != '') {
            $result = '('.$result.')'.$union;
        }

        if ($this->isForUpdate()) {
            $result .= ' FOR UPDATE';
        }

        return $result;
    }
503637
public function generate()
    {
        $code = array();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $propertyCode = $this->getIndentation() . $this->getVisibility() . ' ';
        if ($this->isStatic() === true) {
            $propertyCode .= 'static ';
        }

        $propertyCode .= '$' . $this->name;

        if ($this->defaultValue !== null && $this->defaultValue->getValue() !== null) {
            $propertyCode .= ' = ' . $this->defaultValue . ';';
        } else {
            $propertyCode .= ';';
        }

        $code[] = $propertyCode;

        return implode($this->getLineFeed(), $code);
    }
613354
public function generate()
	{
		if ($this->arrData['space'][0] != '')
		{
			$this->arrStyle[] = 'margin-top:'.$this->arrData['space'][0].'px;';
		}

		if ($this->arrData['space'][1] != '')
		{
			$this->arrStyle[] = 'margin-bottom:'.$this->arrData['space'][1].'px;';
		}

		$this->Template = new \FrontendTemplate($this->strTemplate);
		$this->Template->setData(clone $this->arrData);

		$this->compile();

		$this->Template->inColumn = $this->strColumn;
		$this->Template->style = !empty($this->arrStyle) ? implode(' ', $this->arrStyle) : '';
		$this->Template->class = trim('mod_' . $this->type . ' ' . $this->cssID[1]);
		$this->Template->cssID = ($this->cssID[0] != '') ? ' id="' . $this->cssID[0] . '"' : '';

		if ($this->Template->headline == '')
		{
			$this->Template->headline = $this->headline;
		}

		if ($this->Template->hl == '')
		{
			$this->Template->hl = $this->hl;
		}

		return $this->Template->parse();
	}
961782
public function generate()
    {
        $return = '';

        if (empty($this->thumbnailSize)) {
            $this->thumbnailSize = [
                Config::get('imageWidth'),
                Config::get('imageHeight'),
                'box',
            ];
        }

        $file = FilesModel::findByPk($this->varValue);
        if (null === $file && null !== $this->fallbackImage) {
            $file = FilesModel::findByPk($this->fallbackImage);
        }
        if (null !== $file) {
            $altTag = $file->name;
            $size   = deserialize($this->thumbnailSize);
            $image  = Image::create($file->path, $size)->executeResize();

            $return .= sprintf(
                '<img src="%s" width="%s" height="%s" alt="%s" class="uploaded-image">',
                $image->getResizedPath(),
                $image->getTargetWidth(),
                $image->getTargetHeight(),
                $altTag
            );
        }

        if ($this->addMetaWizard) {
//@todo add meta wizard here
        }

        $return .= parent::generate();

        if ($this->enableReset) {
            $return .= sprintf(
                '<input type="checkbox" name="%s" class="checkbox" value=""><label>%s</label> ',
                $this->strName.'_reset',
                'Reset'
            );
        }

        return $return;
    }
1163864
public function generate(): string
    {
        $elements = [];
        foreach ($this->hiddens as $hidden) {
            $elements[] = $hidden;
        }
        foreach ($this->elements as $element) {
            /** @noinspection PhpUndefinedMethodInspection */
            $elements[] = $element->generate();
        }
        return Tags::form($elements, $this->attributes);
    }