git.cweiske.de
/
anoweco.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade twig to version 3 for php 8.1
[anoweco.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index dbca0979790f4b8f7f1b8c3ae90183e9ba0b03c9..37dd4b11e943eaf368b2209e2394790b480fc3d7 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-4,8
+4,8
@@
require_once __DIR__ . '/../src/anoweco/autoload.php';
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Origin: *");
-$loader = new \Twig
_Loader_Filesystem
(__DIR__ . '/../data/templates/');
-$twig = new \Twig
_
Environment(
+$loader = new \Twig
\Loader\FilesystemLoader
(__DIR__ . '/../data/templates/');
+$twig = new \Twig
\
Environment(
$loader,
array(
//'cache' => '/path/to/compilation_cache',
$loader,
array(
//'cache' => '/path/to/compilation_cache',
@@
-65,7
+65,7
@@
function error($description, $status = 'HTTP/1.0 400 Bad Request')
function render($tplname, $vars = array(), $return = false)
{
function render($tplname, $vars = array(), $return = false)
{
- $template = $GLOBALS['twig']->load
Template
($tplname . '.htm');
+ $template = $GLOBALS['twig']->load($tplname . '.htm');
if ($return) {
return $template->render($vars);
if ($return) {
return $template->render($vars);
@@
-73,4
+73,4
@@
function render($tplname, $vars = array(), $return = false)
echo $template->render($vars);
}
}
echo $template->render($vars);
}
}
-?>
\ No newline at end of file
+?>