code/libraries/joomlatools/library/template/engine/factory.php
public function createEngine($url, array $config = array())
    {
        //Find the file type
        if(!$type = pathinfo($url, PATHINFO_EXTENSION)) {
            $type = $url;
        }

        //Engine not supported
        if(!in_array($type, $this->getFileTypes()))
        {
            throw new RuntimeException(sprintf(
                'Unable to find a template engine for the "%s" file format - did you forget to register it ?', $type
            ));
        }

        //Create the engine
        $identifier = $this->getEngine($type);
        $engine     = $this->getObject($identifier, $config);

        if(!$engine instanceof KTemplateEngineInterface)
        {
            throw new UnexpectedValueException(
                'Engine: '.get_class($engine).' does not implement KTemplateEngineInterface'
            );
        }

        return $engine;
    }
public function createEngine($url, array $config = array())
    {
        //Find the file type
        if(!$type = pathinfo($url, PATHINFO_EXTENSION)) {
            $type = $url;
        }

        //Engine not supported
        if(!in_array($type, $this->getFileTypes()))
        {
            throw new RuntimeException(sprintf(
                'Unable to find a template engine for the "%s" file format - did you forget to register it ?', $type
            ));
        }

        //Create the engine
        $identifier = $this->getEngine($type);
        $engine     = $this->getObject($identifier, $config);

        if(!$engine instanceof KTemplateEngineInterface)
        {
            throw new UnexpectedValueException(
                'Engine: '.get_class($engine).' does not implement KTemplateEngineInterface'
            );
        }

        return $engine;
    }
public function createEngine ( $ url , array $ config = array ( ) ) { //Find the file type if ( ! $ type = pathinfo ( $ url , PATHINFO_EXTENSION ) ) { $ type = $ url ; } //Engine not supported if ( ! in_array ( $ type , $ this -> getFileTypes ( ) ) ) { throw new RuntimeException ( sprintf ( 'Unable to find a template engine for the "%s" file format - did you forget to register it ?' , $ type ) ) ; } //Create the engine $ identifier = $ this -> getEngine ( $ type ) ; $ engine = $ this -> getObject ( $ identifier , $ config ) ; if ( ! $ engine instanceof KTemplateEngineInterface ) { throw new UnexpectedValueException ( 'Engine: ' . get_class ( $ engine ) . ' does not implement KTemplateEngineInterface' ) ; } return $ engine ; }
Create an engine

Note that only paths ending with '.[type]' are supported. If the url is not a path we will assume the url is
the type. If no engine is registered for the specific file type a exception will be thrown.

@param  string $url    The template url or engine type
@param  array $config  An optional associative array of configuration options

@throws InvalidArgumentException If the path is not valid
@throws RuntimeException         If the engine isn't registered
@throws UnexpectedValueException If the engine object doesn't implement the TemplateEngineInterface
@return KTemplateEngineInterface
Create an engine