Craft\SeomaticService::renderSeoMetrics PHP Method

renderSeoMetrics() public method

* -------------------------------------------------------------------------------- Render the SEOmetrics template during LivePreview --------------------------------------------------------------------------------
public renderSeoMetrics ( )
    public function renderSeoMetrics()
    {
        $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 SEOmatic metrics floater template */
        $requestUrl = $this->getFullyQualifiedUrl(craft()->request->url);
        $keywords = "";
        $urlParams = array('url' => $requestUrl, 'keywords' => $keywords);
        $metricsActionUrl = UrlHelper::getActionUrl('seomatic/renderMetrics', $urlParams);
        $vars = array('metricsActionUrl' => $metricsActionUrl);
        $htmlText = craft()->templates->render('_seo_metrics_floater.twig', $vars);
        craft()->templates->includeFootHtml($htmlText);
        method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($oldPath) : craft()->path->setTemplatesPath($oldPath);
    }