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 | 涓婚鏂囦欢澶硅矾寰 |
getBaseUrl()
鏂规硶
public string getBaseUrl()
| ||
{return} | string | 涓婚鏂囦欢澶圭浉瀵筓RL锛堟病鏈夌粨灏惧弽鏂滅嚎锛 |
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 | 涓婚鍚嶇О |
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';
}