public function resolveTemplate($request_string)
    {
        $this->debug(sprintf('resolveTemplate: Resolving %s.', $request_string));

        $template = false;

        $this->buildTemplateIndex();

        // First break off any GET vars appended to the URL, splitting
        // either on '?' or '.html'.
        if (false !== strpos($request_string, '?')) {
            $request_string = substr($request_string, 0, strpos($request_string, '?'));
        } elseif (false !== strpos($request_string, '.html')) {
            $request_string = substr($request_string, 0, strpos($request_string, '.html') + 5);
        }

        // Append .html if not already there
        if ('.html' !== substr($request_string, -5)) {
            $request_string .= '.html';
        }

        $this->debug(sprintf('resolveTemplate: Matching relative template path %s.', $request_string));

        // Search the index for a matching template
        if (array_key_exists($request_string, $this->templateIndex)) {
            $template = $this->templateIndex[$request_string];

            $this->debug(sprintf(
                'resolveTemplate: Resolved Template %s (%s).',
                $template->getRenderName(),
                $template->getFilename()
            ));
        }

        return($template);
    }
public function resolveTemplate($request_string)
    {
        $this->debug(sprintf('resolveTemplate: Resolving %s.', $request_string));

        $template = false;

        $this->buildTemplateIndex();

        // First break off any GET vars appended to the URL, splitting
        // either on '?' or '.html'.
        if (false !== strpos($request_string, '?')) {
            $request_string = substr($request_string, 0, strpos($request_string, '?'));
        } elseif (false !== strpos($request_string, '.html')) {
            $request_string = substr($request_string, 0, strpos($request_string, '.html') + 5);
        }

        // Append .html if not already there
        if ('.html' !== substr($request_string, -5)) {
            $request_string .= '.html';
        }

        $this->debug(sprintf('resolveTemplate: Matching relative template path %s.', $request_string));

        // Search the index for a matching template
        if (array_key_exists($request_string, $this->templateIndex)) {
            $template = $this->templateIndex[$request_string];

            $this->debug(sprintf(
                'resolveTemplate: Resolved Template %s (%s).',
                $template->getRenderName(),
                $template->getFilename()
            ));
        }

        return($template);
    }
public function resolveTemplate ( $ request_string ) { $ this -> debug ( sprintf ( 'resolveTemplate: Resolving %s.' , $ request_string ) ) ; $ template = false ; $ this -> buildTemplateIndex ( ) ; // First break off any GET vars appended to the URL, splitting // either on '?' or '.html'. if ( false !== strpos ( $ request_string , '?' ) ) { $ request_string = substr ( $ request_string , 0 , strpos ( $ request_string , '?' ) ) ; } elseif ( false !== strpos ( $ request_string , '.html' ) ) { $ request_string = substr ( $ request_string , 0 , strpos ( $ request_string , '.html' ) + 5 ) ; } // Append .html if not already there if ( '.html' !== substr ( $ request_string , - 5 ) ) { $ request_string .= '.html' ; } $ this -> debug ( sprintf ( 'resolveTemplate: Matching relative template path %s.' , $ request_string ) ) ; // Search the index for a matching template if ( array_key_exists ( $ request_string , $ this -> templateIndex ) ) { $ template = $ this -> templateIndex [ $ request_string ] ; $ this -> debug ( sprintf ( 'resolveTemplate: Resolved Template %s (%s).' , $ template -> getRenderName ( ) , $ template -> getFilename ( ) ) ) ; } return ( $ template ) ; }
resolveTemplate
Resolve a request type string to a template,
or false if none found.

@param string $request_string
@return MicroCMS\Template\Template|bool $template
resolveTemplate Resolve a request type string to a template or false if none found .