Yii Framework v1.1.10 绫诲弬鑰

CTheme

system.web
缁ф壙 class CTheme » CComponent
婧愯嚜 1.0
鐗堟湰 $Id: CTheme.php 3426 2011-10-25 00:01:09Z alexander.makarow $
婧愮爜 framework/web/CTheme.php
CTheme琛ㄧず涓涓簲鐢ㄧ▼搴忎富棰樸

鍏叡灞炴

闅愯棌缁ф壙灞炴

灞炴绫诲瀷鎻忚堪瀹氫箟鍦
basePath string 涓婚鏂囦欢澶硅矾寰 CTheme
baseUrl string 涓婚鏂囦欢澶圭浉瀵筓RL锛堟病鏈夌粨灏惧弽鏂滅嚎锛 CTheme
name string 涓婚鍚嶇О CTheme
skinPath string 灏忛儴浠剁毊鑲よ矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views/skins鈥欍 CTheme
systemViewPath string 绯荤粺瑙嗗浘璺緞銆傞粯璁ゆ槸鈥楾hemeRoot/views/system鈥欍 CTheme
viewPath string 鎺у埗鍣ㄨ鍥捐矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views鈥欍 CTheme

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
__call() 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 CComponent
__construct() 鏋勯犳柟娉曘 CTheme
__get() 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 CComponent
__isset() 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 CComponent
__set() 璁剧疆涓涓粍浠剁殑灞炴у笺 CComponent
__unset() 璁剧疆涓涓粍浠剁殑灞炴т负null銆 CComponent
asa() 杩斿洖杩欎釜鍚嶅瓧鐨勮涓哄璞° CComponent
attachBehavior() 闄勫姞涓涓涓哄埌缁勪欢銆 CComponent
attachBehaviors() 闄勫姞涓涓涓哄垪琛ㄥ埌缁勪欢銆 CComponent
attachEventHandler() 涓轰簨浠堕檮鍔犱竴涓簨浠跺鐞嗙▼搴忋 CComponent
canGetProperty() 纭畾灞炴ф槸鍚﹀彲璇汇 CComponent
canSetProperty() 纭畾灞炴ф槸鍚﹀彲鍐欍 CComponent
detachBehavior() 浠庣粍浠朵腑鍒嗙涓涓涓恒 CComponent
detachBehaviors() 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 CComponent
detachEventHandler() 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 CComponent
disableBehavior() 绂佺敤涓涓檮鍔犺涓恒 CComponent
disableBehaviors() 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
enableBehavior() 鍚敤涓涓檮鍔犺涓恒 CComponent
enableBehaviors() 鍚敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
evaluateExpression() 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 CComponent
getBasePath() 杩斿洖涓婚鏂囦欢澶硅矾寰 CTheme
getBaseUrl() 杩斿洖涓婚鏂囦欢澶圭浉瀵筓RL锛堟病鏈夌粨灏惧弽鏂滅嚎锛 CTheme
getEventHandlers() 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 CComponent
getLayoutFile() 鏌ユ壘鎸囧畾鎺у埗鍣ㄧ殑甯冨眬鐨勫竷灞鏂囦欢銆 CTheme
getName() 杩斿洖涓婚鍚嶇О CTheme
getSkinPath() 杩斿洖灏忛儴浠剁毊鑲よ矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views/skins鈥欍 CTheme
getSystemViewPath() 杩斿洖绯荤粺瑙嗗浘璺緞銆傞粯璁ゆ槸鈥楾hemeRoot/views/system鈥欍 CTheme
getViewFile() 鏌ユ壘鎸囧畾鎺у埗鍣ㄧ殑瑙嗗浘鐨勮鍥炬枃浠躲 CTheme
getViewPath() 杩斿洖鎺у埗鍣ㄨ鍥捐矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views鈥欍 CTheme
hasEvent() 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 CComponent
hasEventHandler() 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 CComponent
hasProperty() 纭畾灞炴ф槸鍚﹁瀹氫箟銆 CComponent
raiseEvent() 鍙戣捣涓涓簨浠躲 CComponent

灞炴ц缁

basePath 灞炴 鍙
public string getBasePath()

涓婚鏂囦欢澶硅矾寰

baseUrl 灞炴 鍙
public string getBaseUrl()

涓婚鏂囦欢澶圭浉瀵筓RL锛堟病鏈夌粨灏惧弽鏂滅嚎锛

name 灞炴 鍙
public string getName()

涓婚鍚嶇О

skinPath 灞炴 鍙 锛堝彲鐢ㄨ嚜 v1.1锛
public string getSkinPath()

灏忛儴浠剁毊鑲よ矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views/skins鈥欍

systemViewPath 灞炴 鍙
public string getSystemViewPath()

绯荤粺瑙嗗浘璺緞銆傞粯璁ゆ槸鈥楾hemeRoot/views/system鈥欍

viewPath 灞炴 鍙
public string getViewPath()

鎺у埗鍣ㄨ鍥捐矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views鈥欍

鏂规硶璇︾粏

__construct() 鏂规硶
public void __construct(string $name, string $basePath, string $baseUrl)
$name string 涓婚鍚嶇О
$basePath string 鍩烘湰涓婚璺緞
$baseUrl string 鍩烘湰涓婚URL
婧愮爜锛 framework/web/CTheme.php#38 (鏄剧ず)
public function __construct($name,$basePath,$baseUrl)
{
    
$this->_name=$name;
    
$this->_baseUrl=$baseUrl;
    
$this->_basePath=$basePath;
}

鏋勯犳柟娉曘

getBasePath() 鏂规硶
public string getBasePath()
{return} string 涓婚鏂囦欢澶硅矾寰
婧愮爜锛 framework/web/CTheme.php#64 (鏄剧ず)
public function getBasePath()
{
    return 
$this->_basePath;
}

getBaseUrl() 鏂规硶
public string getBaseUrl()
{return} string 涓婚鏂囦欢澶圭浉瀵筓RL锛堟病鏈夌粨灏惧弽鏂滅嚎锛
婧愮爜锛 framework/web/CTheme.php#56 (鏄剧ず)
public function getBaseUrl()
{
    return 
$this->_baseUrl;
}

getLayoutFile() 鏂规硶
public string getLayoutFile(CController $controller, string $layoutName)
$controller CController 鎺у埗鍣
$layoutName string 甯冨眬鍚嶇О
{return} string 甯冨眬鏂囦欢璺緞銆傚鏋滄枃浠朵笉瀛樺湪涓篺alse銆
婧愮爜锛 framework/web/CTheme.php#114 (鏄剧ず)
public function getLayoutFile($controller,$layoutName)
{
    
$moduleViewPath=$basePath=$this->getViewPath();
    
$module=$controller->getModule();
    if(empty(
$layoutName))
    {
        while(
$module!==null)
        {
            if(
$module->layout===false)
                return 
false;
            if(!empty(
$module->layout))
                break;
            
$module=$module->getParentModule();
        }
        if(
$module===null)
            
$layoutName=Yii::app()->layout;
        else
        {
            
$layoutName=$module->layout;
            
$moduleViewPath.='/'.$module->getId();
        }
    }
    else if(
$module!==null)
        
$moduleViewPath.='/'.$module->getId();

    return 
$controller->resolveViewFile($layoutName,$moduleViewPath.'/layouts',$basePath,$moduleViewPath);
}

鏌ユ壘鎸囧畾鎺у埗鍣ㄧ殑甯冨眬鐨勫竷灞鏂囦欢銆

getName() 鏂规硶
public string getName()
{return} string 涓婚鍚嶇О
婧愮爜锛 framework/web/CTheme.php#48 (鏄剧ず)
public function getName()
{
    return 
$this->_name;
}

getSkinPath() 鏂规硶 锛堝彲鐢ㄨ嚜 v1.1锛
public string getSkinPath()
{return} string 灏忛儴浠剁毊鑲よ矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views/skins鈥欍
婧愮爜锛 framework/web/CTheme.php#89 (鏄剧ず)
public function getSkinPath()
{
    return 
$this->getViewPath().DIRECTORY_SEPARATOR.'skins';
}

getSystemViewPath() 鏂规硶
public string getSystemViewPath()
{return} string 绯荤粺瑙嗗浘璺緞銆傞粯璁ゆ槸鈥楾hemeRoot/views/system鈥欍
婧愮爜锛 framework/web/CTheme.php#80 (鏄剧ず)
public function getSystemViewPath()
{
    return 
$this->getViewPath().DIRECTORY_SEPARATOR.'system';
}

getViewFile() 鏂规硶
public string getViewFile(CController $controller, string $viewName)
$controller CController 鎺у埗鍣
$viewName string 瑙嗗浘鍚嶇О
{return} string 瑙嗗浘鏂囦欢璺緞銆傚鏋滄枃浠朵笉瀛樺湪涓篺alse銆
婧愮爜锛 framework/web/CTheme.php#100 (鏄剧ず)
public function getViewFile($controller,$viewName)
{
    
$moduleViewPath=$this->getViewPath();
    if((
$module=$controller->getModule())!==null)
        
$moduleViewPath.='/'.$module->getId();
    return 
$controller->resolveViewFile($viewName,$this->getViewPath().'/'.$controller->getUniqueId(),$this->getViewPath(),$moduleViewPath);
}

鏌ユ壘鎸囧畾鎺у埗鍣ㄧ殑瑙嗗浘鐨勮鍥炬枃浠躲

getViewPath() 鏂规硶
public string getViewPath()
{return} string 鎺у埗鍣ㄨ鍥捐矾寰勩傞粯璁ゆ槸鈥楾hemeRoot/views鈥欍
婧愮爜锛 framework/web/CTheme.php#72 (鏄剧ず)
public function getViewPath()
{
    return 
$this->_basePath.DIRECTORY_SEPARATOR.'views';
}

Copyright © 2008-2011 by Yii Software LLC
All Rights Reserved.