* @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 ) ); } }