Diff
Index: logout.php
--- logout.php (nonexistent)
+++ logout.php (revision 4)
@@ -0,0 +1,31 @@
+<?php
+declare(strict_types = 1);
+
+namespace Views\admin;
+
+use Apex\Svc{View, App};
+
+/**
+ * Render the template.
+ */
+class logout
+{
+
+ /**
+ * Render
+ */
+ public function render(View $view, App $app):void
+ {
+
+ // Logout, if needed
+ if (null !== ($session = $app->getSession())) {
+ $session->logout();
+ $app->setSession(null);
+ $app->setUser(null);
+ }
+
+ }
+
+}
+
+
Full Code
<?php
declare(strict_types = 1);
namespace Views\admin;
use Apex\Svc{View, App};
/**
* Render the template.
*/
class logout
{
/**
* Render
*/
public function render(View $view, App $app):void
{
// Logout, if needed
if (null !== ($session = $app->getSession())) {
$session->logout();
$app->setSession(null);
$app->setUser(null);
}
}
}