chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -4,8 +4,10 @@ namespace App\Framework\View\Processors;
use App\Framework\View\DomProcessor;
use App\Framework\View\DomTemplateParser;
use App\Framework\View\DomWrapper;
use App\Framework\View\Loading\TemplateLoader;
use App\Framework\View\RenderContext;
use App\Framework\View\TemplateLoader;
use Dom\HTMLDocument;
final readonly class IncludeProcessor implements DomProcessor
{
@@ -14,16 +16,14 @@ final readonly class IncludeProcessor implements DomProcessor
private DomTemplateParser $parser = new DomTemplateParser()
) {}
public function process(\DOMDocument $dom, RenderContext $context): void
public function process(DomWrapper $dom, RenderContext $context): DomWrapper
{
$xpath = new \DOMXPath($dom);
foreach ($xpath->query('//include[@file]') as $includeNode) {
foreach ($dom->querySelectorAll('include[file]') as $includeNode) {
$file = $includeNode->getAttribute('file');
try {
$html = $this->loader->load($file);
$includedDom = $this->parser->parse($html);
$includedDom = $this->parser->parseFile($html);
$fragment = $dom->createDocumentFragment();
foreach ($includedDom->documentElement->childNodes as $child) {
@@ -37,5 +37,7 @@ final readonly class IncludeProcessor implements DomProcessor
$includeNode->parentNode?->replaceChild($error, $includeNode);
}
}
return $dom;
}
}