function register($engine, $extension)
    {
        if (!class_exists($engine)) {
            throw new \InvalidArgumentException("Class $engine is not defined");
        }

        if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
            throw new \InvalidArgumentException(
                "An engine must implement \\MetaTemplate\\Template\\TemplateInterface."
            );
        }

        $extensions = (array) $extension;

        foreach ($extensions as $extension) {
            $extension = Template::normalizeExtension($extension);
            $this->engines[$extension] = $engine;
        }

        return $this;
    }
function register($engine, $extension)
    {
        if (!class_exists($engine)) {
            throw new \InvalidArgumentException("Class $engine is not defined");
        }

        if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
            throw new \InvalidArgumentException(
                "An engine must implement \\MetaTemplate\\Template\\TemplateInterface."
            );
        }

        $extensions = (array) $extension;

        foreach ($extensions as $extension) {
            $extension = Template::normalizeExtension($extension);
            $this->engines[$extension] = $engine;
        }

        return $this;
    }
function register ( $ engine , $ extension ) { if ( ! class_exists ( $ engine ) ) { throw new \ InvalidArgumentException ( "Class $engine is not defined" ) ; } if ( ! class_implements ( $ engine , "\\MetaTemplate\\Template\\TemplateInterface" ) ) { throw new \ InvalidArgumentException ( "An engine must implement \\MetaTemplate\\Template\\TemplateInterface." ) ; } $ extensions = ( array ) $ extension ; foreach ( $ extensions as $ extension ) { $ extension = Template :: normalizeExtension ( $ extension ) ; $ this -> engines [ $ extension ] = $ engine ; } return $ this ; }
Registers an engine with one or more extensions

@param  string $engine Engine Class
@param  string|array $extension One or more extensions
@return EngineRegistry
Registers an engine with one or more extensions