HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/fvr.creativefellows.nl/src/Handler/DefaultErrorHandler.php
<?php

namespace App\Handler;

use App\Domain\Page\Data\PageData;
use App\Domain\Navigation\NavigationData;
use App\Domain\Language\LanguageData;
	
use Psr\Http\Message\ResponseInterface;
use Psr\Container\ContainerInterface;
use Slim\Views\PhpRenderer;


final class DefaultErrorHandler 
{	
	
    protected $container;	
	protected $responder;
	protected $language;
	
    public function __construct(
		ContainerInterface $container,
		PhpRenderer $responder,
		LanguageData $language
	) {
        $this->container = $container;
        $this->responder = $responder;
		$this->language = $language;
    }
	
	
    public function respond(ResponseInterface $response, PageData $page, $navigation) : ResponseInterface
	{	
		
		$this->response = $response;
		$this->page = $page;
		$this->navigation = $navigation;
		
		// get the labels
		$localization = $this->language->localizedLanguageData()->setting("labels");
		
		// set meta
		$this->page->setMetaTitle($localization["404"]["title"]);
		$this->page->setMetaDescription($localization["404"]["description"]);	
						
		// return
		return $this->responder->render($this->response, "view.404.php", [
			"navigation" => $this->navigation,
			"page" => $this->page,
			"localization" => $localization,
		])->withStatus(404);			
			
	}
	
	
	



	


	


		


			



	
}