Files
bedrock/classes/controller.php
Joey Kimsey 8f2b00ae19 init
2024-08-07 19:21:20 -04:00

57 lines
1.7 KiB
PHP

<?php
/**
* core/controller.php
*
* The controller handles our main template and provides the
* model and view functions which are the backbone of the tempus
* project. Used to hold and keep track of many of the variables
* that support the applications execution.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Core
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Session;
use TheTempusProject\Houdini\Classes\Issues;
class Controller {
public static $title = null;
public static $pageDescription = null;
public static $template = null;
/**
* Check for issues stored in sessions and add them to current issues.
*/
public static function checkSessions() {
$success = Session::checkFlash( 'success' );
$notice = Session::checkFlash( 'notice' );
$error = Session::checkFlash( 'error' );
$info = Session::checkFlash( 'info' );
if ( !empty( $success ) ) {
Issues::add( 'success', $success );
}
if ( !empty( $notice ) ) {
Issues::add( 'notice', $notice );
}
if ( !empty( $error ) ) {
Issues::add( 'error', $error );
}
if ( !empty( $info ) ) {
Issues::add( 'info', $info );
}
}
public function __construct() {
Debug::log( 'Controller Constructing: ' . get_class( $this ) );
self::checkSessions();
}
public function __destruct() {
Debug::log( 'Controller Destructing: ' . get_class( $this ) );
}
}