Craft\SeomaticService::renderHumans PHP Method

renderHumans() public method

* -------------------------------------------------------------------------------- Render the humans.txt template --------------------------------------------------------------------------------
public renderHumans ( $isPreview = false )
    public function renderHumans($isPreview = false)
    {
        $templatePath = '';
        $locale = '';
        if (!$locale) {
            $locale = craft()->language;
        }
        $metaVars = craft()->seomatic->getGlobals('', $locale);
        if ($templatePath) {
            $htmlText = craft()->templates->render($templatePath);
        } else {
            $oldPath = method_exists(craft()->templates, 'getTemplatesPath') ? craft()->templates->getTemplatesPath() : craft()->path->getTemplatesPath();
            $newPath = craft()->path->getPluginsPath() . 'seomatic/templates';
            method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($newPath) : craft()->path->setTemplatesPath($newPath);
            /* -- Render the core template */
            $templateName = '_humans';
            if ($isPreview) {
                $templateName = $templateName . 'Preview';
            }
            $htmlText = craft()->templates->render($templateName, $metaVars);
            method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($oldPath) : craft()->path->setTemplatesPath($oldPath);
        }
        return $htmlText;
    }