本文整理汇总了PHP中JApplication::_loadSite方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplication::_loadSite方法的具体用法?PHP JApplication::_loadSite怎么用?PHP JApplication::_loadSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplication
的用法示例。
在下文中一共展示了JApplication::_loadSite方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _loadSite
/**
* Load the site
*
* This function checks if the site exists in the request, or in the session. If not it
* falls back on the default site.
*
* @param string $site The name of the site to load
* @return void
* @throws KException If the site could not be found
* @since Nooku Server 0.7
*/
protected function _loadSite($default)
{
$method = strtolower(KRequest::method());
if (KRequest::has($method . '.site')) {
$site = KRequest::get($method . '.site', 'cmd');
} else {
$site = JFactory::getSession()->get('site', $default);
}
parent::_loadSite($site);
}
示例2: _loadSite
/**
* Load the site
*
* This function checks if the site exists in the request, it not it tries
* to get the site form the url falling back on the default is no site was
* found
*
* @param string $site The name of the site to load
* @return void
* @throws KException If the site could not be found
* @since Nooku Server 0.7
*/
protected function _loadSite($site)
{
$method = strtolower(KRequest::method());
if(!KRequest::has($method.'.site'))
{
$uri = clone(JURI::getInstance());
$path = trim(str_replace(array(JURI::base(true)), '', $uri->getPath()), '/');
$path = trim(str_replace('index.php', '', $path), '/');
$segments = array();
if(!empty($path)) {
$segments = explode('/', $path);
}
if(!empty($segments))
{
// Check if the site exists
if(KFactory::get('com://admin/sites.model.sites')->getList()->find($segments[0])) {
$site = array_shift($segments);
}
}
}
else $site = KRequest::get($method.'.site', 'cmd');
parent::_loadSite($site);
}