public function load($ident)
    {
        // Handle dynamic template
        if (substr($ident, 0, 1) === '$') {
            $tryLegacy = ($ident === '$widget_template');

            $ident = $this->dynamicTemplate(substr($ident, 1));

            // Legacy dynamic template hack
            if ($tryLegacy) {
                $ident = empty($GLOBALS['widget_template']) ? $ident : $GLOBALS['widget_template'];
                $this->logger->warning(sprintf(
                    '%s is deprecated in favor of %s: %s',
                    '$GLOBALS[\'widget_template\']',
                    'setDynamicTemplate()',
                    $ident
                ));
                if (!is_string($ident)) {
                    throw new InvalidArgumentException(
                        'Dynamic template ident (from "$widget_template") must be a string'
                    );
                }
            }
        }

        /**
         * Prevents the loader from passing a proper template through further
         * procedures meant for a template identifier.
         */
        if ($this->isTemplateString($ident)) {
            return $ident;
        }

        $file = $this->findTemplateFile($ident);
        if ($file === null || $file === '') {
            return $ident;
        }

        return file_get_contents($file);
    }