Improved templating engine wrapping.

This commit is contained in:
flash 2025-04-03 14:37:19 +00:00
parent e4c3e4c052
commit ceb6bece09
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
86 changed files with 784 additions and 515 deletions

View file

@ -77,10 +77,11 @@ handleValue:
$hostName ??= 'localhost';
// this should really not be necessary, mostly done to make sure the url registry is available
$msz->createRouting(new HttpRequest('1.1', ['Host' => [$hostName]], NullStream::instance(), [], 'GET', HttpUri::createUri('/'), [], []));
$msz->startTemplating(false);
$msz->registerRequestRoutes(
new HttpRequest('1.1', ['Host' => [$hostName]], NullStream::instance(), [], 'GET', HttpUri::createUri('/'), [], [])
);
$ctx = $msz->templating->load(implode(' ', array_slice($argv, $pathIndex)));
$ctx = $msz->tplCtx->loadTemplate(implode(' ', array_slice($argv, $pathIndex)));
foreach($tplArgs as $name => $value)
$ctx->setVar($name, $value);