57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* classes/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 1.1.2
|
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
|
* @link https://TheTempusProject.com/libraries/Bedrock
|
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
|
*/
|
|
namespace TheTempusProject\Bedrock\Classes;
|
|
|
|
use TheTempusProject\Canary\Bin\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 ) );
|
|
}
|
|
}
|