當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JApplication::_loadSite方法代碼示例

本文整理匯總了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);
 }
開發者ID:JSWebdesign,項目名稱:intranet-platform,代碼行數:21,代碼來源:application.php

示例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);
	}
開發者ID:raeldc,項目名稱:com_learn,代碼行數:39,代碼來源:application.php


注:本文中的JApplication::_loadSite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。