theopera/twig-adapter

v1.3 2019-08-10 12:34 UTC

This package is auto-updated.

Last update: 2024-09-10 23:24:19 UTC


README

Build Status

此适配器允许您轻松使用Twig模板引擎来渲染视图。

安装

运行composer require theopera/twig-adapter以获取适配器的副本。要使适配器生效,将以下代码添加到MyContext类中。

public function getTemplateEngine() : RenderInterface
{
    if($this->render === null){
        $this->render = new TwigAdapter($this);
    }
    
    return $this->render;
}

这将覆盖默认的PhpEngine模板引擎。请确保检查您的导入语句。