Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 9
BaseController
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 9
 renderPage
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 9
<?php namespace App\Controllers;
use Framework\MVC\Controller;
abstract class BaseController extends Controller
{
    protected $viewInstance = 'default';
    protected function renderPage(string $page, array $data = [], string $instance = null) : string
    {
        return view('layouts/default', [
            'title' => $data['title'] ?? 'App',
            'header' => view('includes/header'),
            'main' => view("pages/{$page}", $data),
            'sidebar' => view('includes/sidebar'),
            'footer' => view('includes/footer'),
        ], $instance ?? $this->viewInstance);
    }
}