Returns a new instance of the template engine belonging to the given name.

@throws InvalidArgumentException if the given name is not registered
179149
public function get(string $name): TemplateInterface
    {
        if (!isset($this->engines[$name])) {
            throw new InvalidArgumentException('Template engine "' . $name . '" is not known or registered');
        }

        return $this->engines[$name];
    }
1329843
public function create($name)
    {
        $name = $this->resolveName($name);

        $prototype = $this->getPrototype($name);
        $product = $prototype->copy();        
        
        foreach($this->invocationsMethodsOnCreate[$name] as $methodName => $argTag)
        {
            if(isset($this->invokeArgs[$argTag]))
            {
                $arg = $this->invokeArgs[$argTag];
                $product->$methodName($arg);
            }
        }

        return $product;
    }
716176
protected static function getEngine($name)
    {
        if (!isset(self::$engines[$name])) {
            if ($name !== 'default') {
                return false;
            }
            self::registerEngine($name, new PhpConfig());
        }

        return self::$engines[$name];
    }
196408
public Context setEngine(Engine engine) {
        checkThread();
        if (engine != null) {
            if (template != null && template.getEngine() != engine) {
                throw new IllegalStateException("Failed to set the context engine, because is not the same to template engine. template engine: "
                        + template.getEngine().getName() + ", context engine: " + engine.getName()
                        + ", template: " + template.getName() + ", context: " + thread.getName());
            }
            if (parent != null && parent.getEngine() != engine) {
                parent.setEngine(engine);
            }
            if (this.engine == null) {
                setCurrent(engine.createContext(parent, current));
            }
        }
        this.engine = engine;
        return this;
    }
1364276
public static function build($name)
    {
        if (isset(static::$_builtTypes[$name])) {
            return static::$_builtTypes[$name];
        }
        if (!isset(static::$_types[$name])) {
            throw new InvalidArgumentException(sprintf('Unknown type "%s"', $name));
        }
        if (is_string(static::$_types[$name])) {
            return static::$_builtTypes[$name] = new static::$_types[$name]($name);
        }

        return static::$_builtTypes[$name] = static::$_types[$name];
    }
1013381
public function loadTemplate($templateIdent)
    {
        if (!is_string($templateIdent)) {
            throw new InvalidArgumentException(sprintf(
                'Template ident must be a string, received %s',
                is_object($templateIdent) ? get_class($templateIdent) : gettype($templateIdent)
            ));
        }
        if (!$templateIdent) {
            return '';
        }
        return $this->engine()->loadTemplate($templateIdent);
    }
871500
public function make(string $name): Template
    {
        $name = \trim($name, '/\\');
        $file = $this->compile($name);

        return new Template($this, $name, $file);
    }
1234888
protected static function _buildEngine($name)
    {
        $registry = static::registry();

        if (empty(static::$_config[$name]['className'])) {
            throw new InvalidArgumentException(
                sprintf('The "%s" queue configuration does not exist.', $name)
            );
        }

        $config = static::$_config[$name];
        $registry->load($name, $config);
    }
100741
public static Requirement newInstance(String name)
    {
        Requirement requirement = new Requirement();
        requirement.setName(name);
        return requirement;
    }
439923
public static function create($template = null, $view = '', $viewdata = [], $status = 200, $headers = array())
    {
        if (!$template instanceof TemplateEngineInterface) {
            throw new InvalidArgumentException('The first argument of ViewResponse::create must be an instance of Laasti\Response\Engines\TemplateEngineInterface');
        }
        return new static($template, $view, $viewdata, $status, $headers);
    }
289950
public function getEngine($new = false)
    {
        if (!$this->engine || $new) {
            $this->engine = new PlatesEngine(
                dirname($this->config->get('path.found')),
                ltrim($this->config->get('extension', '.tpl'), '.')
            );

            foreach ($this->folders as $namespace => $folder) {
                $this->engine->addFolder($namespace, $folder['folder'], $folder['fallback']);
            }

            foreach ($this->extensions as $extension) {
                $this->engine->loadExtension($extension);
            }
        }

        return $this->engine;
    }
683845
public static synchronized RenderEngine getInstance() {
    //availableEngines = null;
    if (null == availableEngines) {
      availableEngines = new HashMap();
    }

    if (!availableEngines.containsKey(DEFAULT)) {
      RenderEngine engine = new BaseRenderEngine();
      availableEngines.put(engine.getName(), engine);
    }

    return (RenderEngine) availableEngines.get(DEFAULT);
  }
1104240
public static TemplateViewRouteImpl create(String path,
                                               String acceptType,
                                               TemplateViewRoute route,
                                               TemplateEngine engine) {

        return new TemplateViewRouteImpl(path, acceptType, route) {
            @Override
            public String render(ModelAndView modelAndView) {
                return engine.render(modelAndView);
            }

            @Override
            public Object handle(Request request, Response response) throws Exception {
                return route.handle(request, response);
            }
        };
    }
1002211
public static <T> ParameterBuilder<T> create(String name) {
    return new ParameterBuilder<T>()
        .name(name);
  }
280919
protected function load($name)
    {
        if ($name instanceof \Twig_Template) {
            return $name;
        }

        try {
            return $this->environment->loadTemplate($name);
        } catch (\Twig_Error_Loader $e) {
            throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }
    }
283631
protected Template getTemplate(String name) {
    try {
      return configuration.getTemplate(name);
    } catch (IOException e) {
      throw new GenException(Message.DOMAGEN9001, e, e);
    }
  }
1058944
@Override
	public Engine createEngine() {

        if( log.isDebugEnabled() )
            log.debug("Creating engine");

        StandardEngine engine = new StandardEngine();

        // Default host will be set to the first host added
        engine.setRealm(realm);         // Inherited by all children

        return (engine);

    }