Initial commit
This commit is contained in:
56
vendor/bedrock/classes/controller.php
vendored
Normal file
56
vendor/bedrock/classes/controller.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?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 ) );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user