Imported code from old repository
This commit is contained in:
1 parent
976fdc0199
commit
77cf9e05f1
91 files changed
+18969
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
namespace CloudObjects\PhpMAE;
|
||||
|
||||
class TwigTemplate {
|
||||
|
||||
private $key;
|
||||
private $environment;
|
||||
|
||||
public function __construct($key, $content, $cachePath) {
|
||||
$this->key = $key;
|
||||
$this->environment = new \Twig_Environment(
|
||||
new \Twig_Loader_Array([ $key => $content ]),
|
||||
[ 'cache' => $cachePath ]
|
||||
);
|
||||
}
|
||||
|
||||
public function render($context) {
|
||||
return $this->environment->render($this->key, $context);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user