resolveEngine

@param mixed $template

@return EngineInterface|bool false if no engine is false;
518445
public function resolveEngine($template)
    {
        foreach ($this->engines as $engine) {
            if ($engine->supports($template)) {
                return $engine;
            }
        }

        return false;
    }
970754
public function compile(Template $template)
    {
        // Otherwise, we look for a compile method
        $method = 'compile'.ucfirst($template->getName());
        if (!method_exists($this, $method)) {
            return null;
        }

        return $this->$method($template);
    }
1189263
public function render_migration($template)
    {
        $this->controllerReplacements[':migration_class'] = 'Create'.str_plural(studly_case($this->identifier)).'Table';
        $this->controllerReplacements[':table_name'] = str_plural($this->identifier);

        $template = strtr($template, $this->controllerReplacements);

        return $template;
    }
321115
public function resolve($template)
    {
        if (! isset($this->templates[$template])) {
            throw new UnexpectedValueException(sprintf(
                'Unexpected template name "%s" provided.',
                is_string($template) ? $template : gettype($template)
            ));
        }

        return $this->templates[$template];
    }
284655
public function getEngineForTemplate($template)
    {
        if ($this->engine instanceof DelegatingEngine) {
            return $this->prepareEngine($this->engine->resolveEngine($template));
        }

        if ($this->engine->supports($template)) {
            return $this->prepareEngine($this->engine);
        }

        throw new \InvalidArgumentException(sprintf('No engine found for template "%s".', (string)$template));
    }
242483
public function render($template)
    {
        $this->setTemplate($template);
        extract($this->data);
        ob_start();
        require $this->templatePath;

        return ob_get_clean();
    }
878121
private function getRenderer(string $template): string
    {
        if (is_readable($template) === false) {
            throw new View\Exception('Could not open file "' . basename($template) . '"');
        }

        $suffix = strtolower(pathinfo($template, PATHINFO_EXTENSION));

        if (isset($this->renderer[$suffix]) === false) {
            throw new View\Exception('No template engine registered for file extension "' . $suffix . '"');
        }

        return $this->renderer[$suffix];
    }
1179515
private function resolveEngines()
    {
        foreach ($this->engines as $i => $engine) {
            if (\is_string($engine)) {
                $this->engines[$i] = $this->container->get($engine);
            }
        }
    }
960394
public function getTemplateEngine()
    {
        if (null == $this->templateEngine) {
            Template::addPath(dirname(dirname(__DIR__)).'/templates');
            $template = (new Template())->initialize();
            $this->setTemplateEngine($template);
        }
        return $this->templateEngine;
    }
1292933
public function getTemplateEngine()
    {
        if (null == $this->templateEngine) {
            $this->setTemplateEngine($this->getDefaultTemplateEngine());
        }

        return $this->templateEngine;
    }
977605
public function template($template = null)
    {
        if (is_null($template)) {
            return $this->template;
        } else {
            $this->template = $template;
        }
    }
29261
public function setEngine($engine)
    {
        if ($this->isValidEngine($engine)) {
            $this->engine =& $engine;

            return true;
        }

        return false;
    }
1333263
public function render($template = '')
    {
        $result = $template;
        if (is_array($template) || is_object($template)) {
            // Recursively go down into an object/array to tokenize.
            foreach ($result as &$val) {
                $val = $this->render($val);
            }
        } elseif (
            is_string($template)
            && strlen($template) >= self::TEMPLATE_MIN_LENGTH
            && false !== strpos($template, self::TOKEN_KEY_START)
            && false !== strpos($template, self::TOKEN_KEY_END)
        ) {
            if (isset($this->renderCache[$template])) {
                // Already tokenized this exact string.
                $result = $this->renderCache[$template];
            } else {
                // A new or non-tokenized string.
                $this->lastTemplate = $template;
                set_error_handler([$this, 'handleMustacheErrors'], E_WARNING | E_NOTICE);
                $result = $this->engine->render($template, $this->context);
                restore_error_handler();
                if (null !== $result && '' !== $result) {
                    // Store the result in cache for faster lookup later.
                    $this->renderCache[$template] = $result;
                }
            }
        }

        return $result;
    }
895890
public function setHTMLTemplate($template)
    {
        if (substr($template, -3) == '.ss') {
            $template = substr($template, 0, -3);
        }
        $this->HTMLTemplate = $template;

        return $this;
    }
292375
public function render($template = null)
  {
    return $this->getEngine()->render($template ?: $this->getTemplate(), array('layout' => $this));
  }
1191887
public function normalizeTemplate($template)
	{
		$dom = TemplateLoader::load($template);

		// Apply all the normalizations until no more change is made or we've reached the maximum
		// number of loops
		$i = 0;
		do
		{
			$old = $template;
			foreach ($this->collection as $k => $normalization)
			{
				$normalization->normalize($dom->documentElement);
			}
			$template = TemplateLoader::save($dom);
		}
		while (++$i < $this->maxIterations && $template !== $old);

		return $template;
	}
617450
public static function create($template = 'Response') {
	    $return = null;

	    switch ($template) {
            case 'Discovery':
                $return = new AlexaResponse(
                    new Response(
                        new Event(
                            new Header(),
                            new Payload()
                        )
                    )
                );
            break;

            case 'StateReport':
                $return = new AlexaResponse(
                    new Response(
                        new Event(
                            new Header(),
                            new Payload(),
                            new Endpoint()
                        ),
	                    new Context()
                    )
                );
            break;

            case 'Response':
                $return = new AlexaResponse(
                    new Response(
                        new Event(
                            new Header(),
                            new Payload(),
                            new Endpoint()
                        ),
	                    new Context()
                    )
                );
            break;

		    case 'Authorization':
			    $return = new AlexaResponse(
				    new Response(
					    new Event(
						    new Header(),
						    new Payload()
					    )
				    )
			    );
		    break;

		    case 'Error':
			    $return = new AlexaResponse(
				    new Response(
					    new Event(
						    new Header(),
						    new Payload()
					    )
				    )
			    );
		    break;

            default:
                throw new InvalidArgumentException('Unsupported AlexaResponse template: ' . $template);
            break;
        }

        return $return;
	}