generates an file header string

@param string		$title
@param array 		$data
@return string
966277
protected function file_header( $title, $data = array() ) 
	{	
		$conf = \CCConfig::create( 'shipyard' );
		$data = CCDataObject::assign( $data );
		
		// Build the authors string
		$authors = $data->get( 'authors', $conf->get( 'defaults.authors' ) );		
		
		if ( is_array( $authors ) )
		{
			foreach( $authors as $person ) 
			{
				$author_str .= $person['name']." ";
				if ( array_key_exists( 'email', $person ) ) 
				{
					$author_str .= "<".$person['email'].">";
				}
				$author_str .= ", ";
			}
			$author_str = substr( $author_str, 0, -2 );
		}
		
		// Finish comment heeader
		return "$title\n".
			"*\n".
			"\n".
			"@package       ".$data->get( 'package', $conf->get( 'defaults.package' ) )."\n".
			"@author        ".$author_str."\n".
			"@version       ".$data->get( 'version', $conf->get( 'defaults.version' ) )."\n".
			"@copyright     ".$data->get( 'copyright', $conf->get( 'defaults.copyright' ) )."\n";
	}
196824
public function format($name, array $data) {
        $name = $this->_getTemplateName($name, $data);
        return parent::format($name, $data);
    }
915474
public function listToString(
        $data,
        string $title = null,
        string $titleAddition = null,
        string $class = null,
        string $delimiter = null,
        string $delimiterAddition = null,
        string $view = null
    ): string {
        $view = $view ?: 'column.listToString';

        return GridView::view($view, [
            'data'              => $data,
            'title'             => $title,
            'titleAddition'     => $titleAddition,
            'class'             => $class,
            'delimiter'         => $delimiter,
            'delimiterAddition' => $delimiterAddition,
        ])->render();
    }
896873
function title( $contentObjectAttribute,  $name = "original_filename" )
    {
        $mediaFile = eZMedia::fetch( $contentObjectAttribute->attribute( "id" ),
                                      $contentObjectAttribute->attribute( "version" ) );

        if ( $mediaFile != null )
            $value = $mediaFile->attribute( $name );
        else
            $value = "";
        return $value;
    }
5591
public static function getHeaders(string $data): string
    {
        $pos = strpos($data, "\r\n\r\n");

        return $pos === false ? '' : substr($data, 0, $pos);
    }
641851
public function generatePageTitle($title)
    {
        // INIT
        $ret              = $title;
        $rawTitle         = !empty($GLOBALS['TSFE']->altPageTitle) ?
            $GLOBALS['TSFE']->altPageTitle : $GLOBALS['TSFE']->page['title'];
        $currentPid       = $GLOBALS['TSFE']->id;
        $skipPrefixSuffix = false;
        $applySitetitle   = true;

        $pageTitlePrefix = false;
        $pageTitleSuffix = false;

        $this->stdWrapList = array();

        $sitetitle = $this->tsSetup['sitetitle'];

        // Use browsertitle if available
        if (!empty($GLOBALS['TSFE']->page['tx_metaseo_pagetitle_rel'])) {
            $rawTitle = $GLOBALS['TSFE']->page['tx_metaseo_pagetitle_rel'];
        }

        // Call hook
        GeneralUtility::callHookAndSignal(
            __CLASS__,
            'pageTitleSetup',
            $this,
            $this->tsSetupSeo
        );

        // get stdwrap list
        if (!empty($this->tsSetupSeo['pageTitle.']['stdWrap.'])) {
            $this->stdWrapList = $this->tsSetupSeo['pageTitle.']['stdWrap.'];
        }

        // Apply stdWrap before
        if (!empty($this->stdWrapList['before.'])) {
            $rawTitle = $this->cObj->stdWrap($rawTitle, $this->stdWrapList['before.']);
        }

        // #######################################################################
        // RAW PAGE TITLE
        // #######################################################################
        if (!empty($GLOBALS['TSFE']->page['tx_metaseo_pagetitle'])) {
            $ret = $GLOBALS['TSFE']->page['tx_metaseo_pagetitle'];

            // Add template prefix/suffix
            if (empty($this->tsSetupSeo['pageTitle.']['applySitetitleToPagetitle'])) {
                $applySitetitle = false;
            }

            $skipPrefixSuffix = true;
        }


        // #######################################################################
        // PAGE TITLE PREFIX/SUFFIX
        // #######################################################################
        if (!$skipPrefixSuffix) {
            $pageTitlePrefix = $this->applyInheritance('tx_metaseo_pagetitle_prefix', $currentPid);
            $pageTitleSuffix = $this->applyInheritance('tx_metaseo_pagetitle_suffix', $currentPid);

            // #################
            // Process settings from access point
            // #################
            $connector = $this->objectManager->get('Metaseo\\Metaseo\\Connector');
            $store     = $connector->getStore('pagetitle');

            if (!empty($store)) {
                if (isset($store['pagetitle.title'])) {
                    $rawTitle = $store['pagetitle.title'];
                }

                if (isset($store['pagetitle.prefix'])) {
                    $pageTitlePrefix = $store['pagetitle.prefix'];
                }

                if (isset($store['pagetitle.suffix'])) {
                    $pageTitleSuffix = $store['pagetitle.suffix'];
                }

                if (isset($store['pagetitle.absolute'])) {
                    $rawTitle = $store['pagetitle.absolute'];

                    $pageTitlePrefix = false;
                    $pageTitleSuffix = false;

                    if (empty($this->tsSetupSeo['pageTitle.']['applySitetitleToPagetitle'])) {
                        $applySitetitle = false;
                    }
                }

                if (isset($store['pagetitle.sitetitle'])) {
                    $sitetitle = $store['pagetitle.sitetitle'];
                }
            }

            // Apply prefix and suffix
            if ($pageTitlePrefix !== false || $pageTitleSuffix !== false) {
                $ret = $rawTitle;

                if ($pageTitlePrefix !== false) {
                    $ret = $pageTitlePrefix . ' ' . $ret;
                }

                if ($pageTitleSuffix !== false) {
                    $ret .= ' ' . $pageTitleSuffix;
                }

                if (!empty($this->tsSetupSeo['pageTitle.']['applySitetitleToPrefixSuffix'])) {
                    $applySitetitle = true;
                }
            } else {
                $ret = $rawTitle;
            }
        }

        // #######################################################################
        // APPLY SITETITLE (from setup)
        // #######################################################################
        if ($applySitetitle) {
            $ret = $this->applySitetitleToPagetitle($sitetitle, $ret);
        }

        // Apply stdWrap after
        if (!empty($this->stdWrapList['after.'])) {
            $ret = $this->cObj->stdWrap($ret, $this->stdWrapList['after.']);
        }

        return $ret;
    }
1160779
protected function showSuccess($title, $messages = '', $output)
    {
        $output->writeln("<info>$title</info>");
        $output->writeln('');
        if (is_array($messages)) {
            foreach ($messages as $message) {
                $output->writeln("$message");
            }
            $output->writeln('');
        } elseif ($messages != '') {
            $output->writeln($messages);
            $output->writeln('');
        }
    }
1077519
public static function generate_html_id($title)
    {
        $t = $title;
        $t = str_replace('&amp;', '-and-', $t);
        $t = str_replace('&', '-and-', $t);
        $t = preg_replace('/[^A-Za-z0-9]+/', '-', $t);
        $t = preg_replace('/-+/', '-', $t);
        $t = trim($t, '-');
        $t = strtolower($t);

        return $t;
    }
184410
public function title(string $title): Command
    {
        $size = strlen($title);
        $spaces = str_repeat(' ', $size);

        $this->output->newLine();
        $this->output->writeln("<bg=blue;fg=white>$spaces$spaces$spaces</>");
        $this->output->writeln("<bg=blue;fg=white>$spaces$title$spaces</>");
        $this->output->writeln("<bg=blue;fg=white>$spaces$spaces$spaces</>");
        $this->output->newLine();

        return $this;
    }
911420
protected function generateFileHeader()
	{
		$head = array();

		// Build the log file header.

		// If the no php flag is not set add the php die statement.
		if (empty($this->options['text_file_no_php']))
		{
			// Blank line to prevent information disclose: https://bugs.php.net/bug.php?id=60677
			$head[] = '#';
			$head[] = '#<?php die(\'Forbidden.\'); ?>';
		}

		$head[] = '#Date: ' . gmdate('Y-m-d H:i:s') . ' UTC';
		$head[] = '';

		// Prepare the fields string
		$head[] = '#Fields: ' . strtolower(str_replace('}', '', str_replace('{', '', $this->format)));
		$head[] = '';

		return implode("\n", $head);
	}
1081944
def generate_page_title(self, data_slug):
        """"""
        tag = Tag.objects.filter(slug=data_slug)
        return tag[0].word
1122578
protected function resolveDataTitle($data)
    {
        if (!$data->getId()) {
            return $this->get('translator')->trans('node.form.new', array(), 'clastic');
        }

        return $data->getNode()->getTitle();
    }
185809
public function getUrl(DataTable $data, $width, $height, $title = null, $params = array(), $rawParams = array()) {
        
        $title      = isset($title) ? $title: null;
        $titleSize  = isset($params['titleSize']) ? $params['titleSize']: null;
        $titleColor  = isset($params['titleColor']) ? $params['titleColor']: $this->options['titleColor'];
        $withLabels = isset($params['withLabels']) ? $params['withLabels']: $this->options['withLabels'];
        $withLegend = isset($params['withLegend']) ? $params['withLegend']: $this->options['withLegend'];
        $transparent = isset($params['transparent']) ? $params['transparent']: $this->options['transparent'];
        $backgroundFillColor = isset($params['backgroundFillColor']) ? $params['backgroundFillColor']: null;
        $color = isset($params['color']) ? $params['color']: null;
        
        if (is_array($color)) {
            $color = implode('|', $color);
        } else {
            $color = $color? $color: null;
        }
        
        $labels = null;
        if ($withLabels) {
            $labels = implode('|', $data->getLabels());
        }
        //still no legend but should have one?  Take the default one...
        $legendString = $this->getLegendParamValue($data);
        
        $dataString = $this->getValueParamValue($data);
        
        //backgroundFill
        if (!is_null($backgroundFillColor)) {
            $chf = 'bg';
            if ($transparent) {
                $chf = 'a';
            }
            $chf = $chf . ',s,' . $backgroundFillColor;
        }
        $params = array(
            'chd' => $dataString,
            'cht'  => static::CHART_TYPE,
            'chs'  => $width . 'x' . $height,
            'chco' => $color,
            'chtt' => $title,
            'chts' => $titleColor . ',' . $titleSize,
            'chl'  => isset($labels)? $labels : null,
            'chdl' => isset($legendString)? $legendString : null,
            'chf'  => isset($chf)? $chf : null,
        );
        
        $params = array_merge($params, $rawParams);
        
        return self::BuildUrl($params);
    }
1002028
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $folder = $recordFinder->findDemoFolderObject();
        return $folder->getCombinedIdentifier();
    }
27521
public function multipart(array $data = [], $files = false) {

        if(is_array($files)) {

            foreach($files as $name => $file) {

                $data[$name] = $this->file($file);

            }

        }

        $this->params = $data;

        return $this->header(['Content-Type' => 'multipart/form-data']);
    }
114498
public function save(array $headers, array $data)
    {
        $output = $contents = [];

        $enclosure = $this->getCsvEnclosure();
        $delimiter = $this->getCsvDelimiter();

        $contents[] = $enclosure
            . implode($enclosure . $delimiter . $enclosure, $headers)
            . $enclosure;

        if (!empty($data)) {
            foreach ($data as $item) {
                foreach ($item as $line) {
                    foreach ($headers as $index => $value) {
                        if (isset($line[$value]) && $line[$value] !== '') {
                            $output[$value] = $enclosure . (string)$line[$value] . $enclosure;
                            unset($line[$value]);
                        } else {
                            $output[$value] = '';
                        }
                    }
                    $contents[] = implode($delimiter, array_merge($output, $line));
                }
            }
        }

        $filePath = $this->getFilePath();

        if (file_put_contents($filePath, chr(239) . chr(187) . chr(191) . implode("\n", $contents))) {
            return $filePath;
        }

        return '';
    }
1198677
protected function renderTitle($title, $cellPadding, $columnsWidths) {
		$columnsNumber = count($columnsWidths);
		$tableWidth    = array_sum($columnsWidths) + $columnsNumber + ($columnsNumber * $cellPadding * 2) - 1;
		
		$content = '+' . str_repeat('-', $tableWidth) . '+' . PHP_EOL;
		
		$content .= '|';
		$content .= str_repeat(' ', $cellPadding);
		$content .= $title;
		$content .= str_repeat(' ', $tableWidth - $this->strlen($title) - $cellPadding);
		$content .= '|';
		
		return $content;
	}