<?php

namespace Layout\Controller;

use App\Controller\App;
use ArrayObject;

class Controller extends App {

    protected function render(string $view, array $params = []): mixed {

        $contents = $this->app->render($view, $params);

        $view = 'layout:layouts/layout.php';
        $view .= $this->layout ? " with ".$this->layout:"";

        return $this->app->render($view, compact('contents'));
    }

}
