本文整理匯總了PHP中School::getFromDomain方法的典型用法代碼示例。如果您正苦於以下問題:PHP School::getFromDomain方法的具體用法?PHP School::getFromDomain怎麽用?PHP School::getFromDomain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類School
的用法示例。
在下文中一共展示了School::getFromDomain方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isDomainGood
public static function isDomainGood($domain)
{
return !School::getFromDomain($domain) == null;
}
示例2: substr
//some magic to grab the uri
$replace = substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], "/index.php"));
$uri = substr(str_replace($replace, '', $_SERVER['REQUEST_URI']), 1);
//strip the app's dir from the uri
$subdomain = current(explode('.', $_SERVER['HTTP_HOST']));
if (strrpos($uri, '?')) {
$uri = substr($uri, 0, strrpos($uri, '?'));
}
$uri = explode("/", $uri);
//expload the URI into happy information!
$errStr = "";
$user = "";
//this singleton class may (or may not) contain some useful functions for this app
$app = Application::getInstance();
$user = new User(true);
$school = School::getFromDomain($subdomain);
if ($subdomain != "www" && !$school) {
header("Location: http://www.sneffel.com");
exit;
}
if (!$school || $subdomain == "www") {
$default = "main";
} else {
$default = "subdomain";
}
//includes the appropriate controller/view
$controller = $uri[0];
if ($controller == 'new') {
$controller = $default;
}
/*if (!isset($controllerPageMap[$controller]) || !file_exists('view/'.$controllerPageMap[$controller][1]))