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);
    }
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);
    }
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 ) ; }
Load a template content

@deprecated $GLOBALS['widget_template']

@param  string $ident The template ident to load and render.
@throws InvalidArgumentException If the dynamic template identifier is not a string.
@return string
Load a template content