The main method of the PlugIn
@param    string $content : The PlugIn content
@param    array $conf : The PlugIn configuration
@return    string The content that is displayed on the website
548228
public function main($content, $conf)
    {
        $this->ms = GeneralUtility::milliseconds();

        $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
        $this->conf = $typoScriptService->convertTypoScriptArrayToPlainArray($conf);
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();

        // Configuring so caching is not expected. This value means that no cHash params are ever set.
        // We do this, because it's a USER_INT object!
        $this->pi_USER_INT_obj = 1;

        // initializes plugin configuration
        $this->init();

        // init template for pi1
        $this->initFluidTemplate();

        // hook for initials
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $_procObj->addInitials($this);
            }
        }

        // get content for searchbox
        $this->getSearchboxContent();

        // assign variables and do the rendering
        $this->searchFormView->assignMultiple($this->fluidTemplateVariables);
        $htmlOutput = $this->searchFormView->render();

        return $htmlOutput;
    }
931948
public function contentParser($content)
    {
        return str_replace(['{{dataApiUrl}}', '{{title}}', '{{template}}'], [$this->getDataApiUrl(), $this->getTitle(), $this->_template], $content);
    }
1031922
public function markdown($content)
    {
        // Parse the field as Markdown, return HTML
        $output = $this->markdown->text($content);

        $config = $this->config->get('general/htmlcleaner');
        $allowedTags = !empty($config['allowed_tags']) ? $config['allowed_tags'] :
            ['div', 'p', 'br', 'hr', 's', 'u', 'strong', 'em', 'i', 'b', 'li', 'ul', 'ol', 'blockquote', 'pre', 'code', 'tt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'dd', 'dl', 'dh', 'table', 'tbody', 'thead', 'tfoot', 'th', 'td', 'tr', 'a', 'img'];
        $allowedAttributes = !empty($config['allowed_attributes']) ? $config['allowed_attributes'] :
            ['id', 'class', 'name', 'value', 'href', 'src'];

        // Sanitize/clean the HTML.
        $maid = new Maid(
            [
                'output-format'   => 'html',
                'allowed-tags'    => $allowedTags,
                'allowed-attribs' => $allowedAttributes,
            ]
        );
        $output = $maid->clean($output);

        return $output;
    }
830229
private function buildHeader(string $content): string
    {
        $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n";
        $header .= "Host: api.flowdock.com\r\n";
        $header .= "Content-Type: application/json\r\n";
        $header .= "Content-Length: " . strlen($content) . "\r\n";
        $header .= "\r\n";

        return $header;
    }
523488
protected function getContentObjectVariables(array $conf = array())
    {
        // Call Parent Function to maintain core functions
        $variables = parent::getContentObjectVariables($conf);

        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
        $this->inlineHelper = $objectManager->get(InlineHelper::class);

        // Make some enhancements to data
        $data = $variables['data'];
        $this->inlineHelper->addFilesToData($data, "pages");
        $this->inlineHelper->addIrreToData($data, "pages");
        $variables['data'] = $data;

        return $variables;
    }
658516
protected function ajaxContent($content)
    {
        $message = null;

        $this->header('Content-Type', 'application/json');

        if ($content instanceof Arrayable) {
            $content = $content->toArray();
        } elseif (is_string($content)) {
            $content = ['content' => $content];
        } elseif (!is_array($content) && !$content instanceof \Exception) {
            return $this->ajaxContent(new \Exception("No valid content has been submitted!", BaseResponse::HTTP_BAD_REQUEST));
        } elseif ($content instanceof \Exception) {

            $this->setStatusCode($content->getCode() < 300 ? BaseResponse::HTTP_BAD_REQUEST : $content->getCode());

            $message = $content->getMessage();

            if ($content instanceof MbException) {
                $content = $content->getMessages();
            } else {
                $content = null;
            }
        }

        $this->original = [
            'meta' => [
                'code'    => $this->getStatusCode(),
                'message' => $message,
            ],
            'data' => $content,
        ];

        $this->getMbAudit()->setResponseType('ajax');
        $this->getMbAudit()->setResponseData($this->original);

        return $this->original;
    }
1072903
public static function buildAndGetPage(string $content) :string {
		// initial content
		$page = '<!doctype html><html lang="'.\Polyfony\Locales::getLanguage().'"><head><title>'.(isset(self::$_metas['title']) ? self::$_metas['title'] : '').'</title><meta http-equiv="content-type" content="text/html; charset=' . \Polyfony\Response::getCharset() . '" />';
		// add the meta tags and the links
		$page .= self::buildMetasTags() . self::buildLinksTags();
		// close the head, add the body, and add the scripts
		$page .= '</head><body>' . $content . self::buildScriptsTags();
		// add the profiler (if enabled)
		$page .= \Polyfony\Config::get('profiler', 'enable') ? new \Polyfony\Profiler\HTML : '';
		// close the document and return the assembled html page
		return $page . '</body></html>';

	}
148459
public function setContent($content)
    {
        if (!is_null($content)) {
            $content = (string) $content;
        }

        $this->content = $content;
        return $this;
    }
1320876
public function config(string $conf)
    {
        if (!isset($this->configs[$conf])) {
            $file = $this->getDirectory()."configs/$conf.php";
            $this->configs[$conf] = require $file;
        }

        return $this->configs[$conf];
    }
774657
public function parse($content)
    {
        if (strpos($content, '@ORM') === false) {
            return null;
        }

        if (preg_match(self::PATTERN, $content, $matches)) {
            return (new \SplFixedArray(2))->fromArray([$matches[1], $matches[2]]);
        }

        return null;
    }
161481
private function buildHeader(string $content): string
    {
        $header = "POST " . static::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
        $header .= "Host: " . static::FLEEP_HOST . "\r\n";
        $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $header .= "Content-Length: " . strlen($content) . "\r\n";
        $header .= "\r\n";

        return $header;
    }
1153918
private function guessContentType($content)
    {
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);

        if (is_resource($content)) {
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
        }

        return $fileInfo->buffer($content);
    }
82407
private function createJavascriptResponse($content)
    {
        $rf = $this->app->make(ResponseFactoryInterface::class);

        return $rf->create(
            $content,
            200,
            [
                'Content-Type' => 'application/javascript; charset=' . APP_CHARSET,
                'Content-Length' => strlen($content),
            ]
        );
    }
33364
public function main($content, $conf)
    {
        $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
        $this->init($conf);
        $singleSelection = $this->getSingleRecords();
        $groupSelection = $this->getRecordsFromGroups();

        $templateCode = $this->getTemplate();

        // apply sorting
        $addresses = $this->sortAddresses($singleSelection, $groupSelection);

        // limit output to max listMaxItems addresses
        if (((int)$this->conf['listMaxItems']) > 0) {
            $addresses = array_slice($addresses, 0, (int)$this->conf['listMaxItems']);
        }

        // output
        foreach ($addresses as $address) {
            if (!empty($address)) {
                $markerArray = $this->getItemMarkerArray($address);
                $subpartArray = $this->getSubpartArray($templateCode, $markerArray, $address);

                $addressContent = $this->templateService->substituteMarkerArrayCached(
                    $templateCode,
                    $markerArray,
                    $subpartArray
                );

                $wrap = $this->conf['templates.'][$this->conf['templateName'] . '.']['wrap'];
                $content .= $this->cObj->wrap($addressContent, $wrap);
                $content .= LF . LF;
            }
        }

        $templateAllWrap = $this->conf['templates.'][$this->conf['templateName'] . '.']['allWrap'];
        $content = $this->cObj->wrap($content, $templateAllWrap);

        $content = $this->cObj->wrap($content, $this->conf['wrap']);

        return $this->pi_wrapInBaseClass($content);
    }
1266651
protected function prepareTpl(&$content)
    {
        $this->modx->loadClass('modParser', '', false, true);
        $parser = new Parser($this->modx);
        $this->modx->toPlaceholders($this->profile);
        $this->modx->toPlaceholders($this->request->args());
        $parser->processElementTags('', $content);
    }
916649
private function render($content, array $attributes = []): string
    {
        $template = $attributes[$this->attributeName] ?? '';

        return $this->environment->render($template, ['content' => $content]);
    }
575937
public static function span(
        string $content = null, 
        array $attributes = []
    ) : string 
    {
        return self::tag("span", $content, $attributes);
    }