Latte\Runtime\Template::renderToContentType PHP Method

renderToContentType() protected method

protected renderToContentType ( $mod ) : void
return void
    protected function renderToContentType($mod)
    {
        if ($mod && $mod !== $this->contentType) {
            if ($filter = is_string($mod) ? Filters::getConvertor($this->contentType, $mod) : $mod) {
                echo $filter($this->capture([$this, 'render']), $this->contentType);
                return;
            }
            trigger_error("Including '{$this->name}' with content type " . strtoupper($this->contentType) . ' into incompatible type ' . strtoupper($mod) . '.', E_USER_WARNING);
        }
        $this->render();
    }