Reorganized the CSS structure to there is some seperation between front facing style and the backend den. Also add the Render class so auth status is included in every template rendering event so login status and select member data is available if needed. will expand if needed.
35 lines
843 B
PHP
35 lines
843 B
PHP
<?php
|
|
|
|
namespace App\Service;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
|
|
class Render extends AbstractController
|
|
{
|
|
private $auth;
|
|
|
|
public function __construct(Auth $auth)
|
|
{
|
|
$this->auth = $auth;
|
|
}
|
|
|
|
public function page($options, $title, $template)
|
|
{
|
|
$loggedIn = false;
|
|
$role = 0;
|
|
$handle = "Random Person";
|
|
$result = $this->auth->status();
|
|
if ($result["status"]) {
|
|
$loggedIn = $result["status"];
|
|
$handle = $result["handle"];
|
|
$role = $result["role"];
|
|
}
|
|
return $this->render($template, [
|
|
"title" => $title,
|
|
"loggedIn" => $loggedIn,
|
|
"handle" => $handle,
|
|
"role" => $role,
|
|
"options" => $options,
|
|
]);
|
|
}
|
|
}
|