本文整理汇总了PHP中Framework::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Framework::instance方法的具体用法?PHP Framework::instance怎么用?PHP Framework::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_instance
public static function get_instance()
{
if (null == self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
示例2: Framework
function Framework()
{
global $Page, $argData, $viewClass, $viewConfig, $db, $Auth, $hostConfig;
self::$instance = $this;
// Pseudo-singleton instancing
$this->debugInit();
// Init Debug Logging
// Site Configuration - Autodetect Settings based on Hostname
$hasConfig = !$this->detectHost(trim(`hostname -s`)) ? $this->detectHost(trim(`hostname`)) : -3;
if (!$hasConfig) {
$this->debug(DEBUG_FATAL, "Failed to detect server name [" . trim(`hostname -s`) . "]\nOK1={$ok1}, OK2={$ok2}\nROK={$rok}\n");
}
// Instance Authentication Daemon, if one is configured or loaded
if (!class_exists("AuthSession")) {
$this->debug(DEBUG_FATAL, "No AuthSession class seems to be loaded");
}
$Auth = new AuthSession();
// Load View Handlers
$this->views = $this->findHandlers("Views/");
// Parse URL for argument data
$argData = isset($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) > 2 ? explode("/", $_SERVER['PATH_INFO']) : array();
array_shift($argData);
// If a view was specified, load the handler
if (isset($argData[0])) {
$viewConfig = $this->initHandler($argData[0]);
$viewClass = new $viewConfig['class'](true);
array_shift($argData);
} else {
$viewClass = $viewConfig = "";
}
return;
}
示例3: bodyClass
/**
* Retrieves the body classes
*
* @param string|array $classes Additional body classes
*
* @return string
*/
public function bodyClass($classes = [])
{
$classes = !is_array($classes) ? explode(' ', $classes) : $classes;
$classes = get_body_class($classes);
if (Framework::instance()->getThemeOption('navbar_location') === 'fixed') {
$classes[] = 'fixed-nav';
}
$classes = apply_filters('novusopress_view_body_classes', $classes);
$output = sprintf('class="%s"', implode(' ', $classes));
return apply_filters('novusopress_view_body_class_output', $output);
}