本文整理汇总了PHP中Routes::getRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP Routes::getRoute方法的具体用法?PHP Routes::getRoute怎么用?PHP Routes::getRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Routes
的用法示例。
在下文中一共展示了Routes::getRoute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: StartApp
public static function StartApp()
{
ob_start('ob_gzhandler');
session_start();
// Defines
define('BASEURL', substr((empty($_SERVER['HTTPS']) ? 'http://' : 'https://' ) . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'],0,-10));
define('BASEPATH', substr($_SERVER['SCRIPT_FILENAME'],0,-10));
// Helper Boot Loader
require(BASEPATH.'/core/bootloader.php');
// Initialize Helpers
BootLoader::loadHelpers();
Registry::getInstance();
// Handle Errors
Registry::setDebugMode(true);
set_error_handler('Template::handleError');
set_exception_handler('Template::handleException');
// Initialize Database
Model::$db = DBO::getInstance('sqlite:example.sqldb');
// Init Autoloads
spl_autoload_register('Autoload::controllers');
spl_autoload_register('Autoload::models');
// Determine Controllers and Methods
Routes::getRoute();
// Run Application
Routes::run();
}
示例2: MongoId
/**
* Created by PhpStorm.
* User: babenoff
* Date: 03.12.2015
* Time: 15:20
*/
if (isset($_COOKIE["LD"])) {
if (isset($_SESSION["aid"])) {
if ($G->locations->count() < 1) {
require_once ROOT_DIR . "/data/blank.php";
}
$player = $G->players->findOne(["_id" => new MongoId($_SESSION["aid"])]);
if (!is_null($player)) {
$action = $_GET["game"];
if (file_exists(ROOT_DIR . "/game/g_" . $action . ".php")) {
require ROOT_DIR . "/game/g_" . $action . ".php";
} else {
require ROOT_DIR . "/site/404.php";
}
$player["last_action"] = microtime();
$G->players->update(["_id" => new MongoId($player["_id"])], $player);
} else {
$_SESSION = [];
header("Location: " . Routes::getRoute("CABINET"));
}
} else {
header("Location: " . Routes::getRoute("CABINET"));
}
} else {
header("Location: " . Routes::getRoute("MAIN_PAGE"));
}