Craft\Seomatic_SettingsModel::getDefaultRobots PHP Method

getDefaultRobots() public method

* -------------------------------------------------------------------------------- Get the default robots.txt template --------------------------------------------------------------------------------
public getDefaultRobots ( )
    public function getDefaultRobots()
    {
        $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);
        /* -- Return the robots.txt default template */
        $templateName = '_robotsDefault';
        $loader = new TemplateLoader();
        $template = $loader->getSource($templateName);
        method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($oldPath) : craft()->path->setTemplatesPath($oldPath);
        return $template;
    }