本文整理汇总了PHP中MainController::startApplication方法的典型用法代码示例。如果您正苦于以下问题:PHP MainController::startApplication方法的具体用法?PHP MainController::startApplication怎么用?PHP MainController::startApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainController
的用法示例。
在下文中一共展示了MainController::startApplication方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SessionModel
require_once 'model/DAL/UsersDAL.php';
require_once 'view/LoginView.php';
require_once 'view/LayoutView.php';
require_once 'view/DateTimeView.php';
require_once 'view/RegisterView.php';
require_once 'controller/MainController.php';
require_once 'controller/LoginController.php';
require_once 'controller/RegisterController.php';
//Error reporting.
error_reporting(E_ALL);
ini_set('display_errors', 'Off');
//Creates an object of SessionModel.
$sessionModel = new SessionModel();
//Creates an object of UserCatalogue.
$userCatalogue = new UserCatalogue();
//Creates an object of LoginModel.
$loginModel = new LoginModel($userCatalogue);
//Creates an object of RegisterModel.
$registerModel = new RegisterModel($userCatalogue);
//Creates objects of the views.
$loginView = new LoginView($loginModel);
$registerView = new RegisterView($registerModel);
$layoutView = new LayoutView();
$dateTimeView = new DateTimeView();
//Creates an object of MainController.
$mainController = new MainController($sessionModel, $loginModel, $loginView, $registerModel, $registerView);
$mainController->startApplication();
//Creates a variable with the current login-state.
$isLoggedIn = $loginModel->getIsLoggedIn();
//Calls the method that handles the rendering to the client.
$layoutView->render($isLoggedIn, $loginView, $dateTimeView, $registerView);