本文整理汇总了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]))