CExtController
鍖 | system.web |
---|---|
缁ф壙 | class CExtController » CController » CBaseController » CComponent |
婧愯嚜 | 1.0 |
鐗堟湰 | $Id: CExtController.php 3515 2011-12-28 12:29:24Z mdomba $ |
婧愮爜 | framework/web/CExtController.php |
CExtController鏄綔涓烘墿灞曞垎甯冨紡鎺у埗鍣ㄧ殑鍩虹被銆
CExtController鐨勪富瑕佺洰鐨勬槸閲嶅畾涔viewPath灞炴 浠ヨ嚧浜庡畠鑳芥寚鍚戔渧iews鈥濆瓙鐩綍瀹冨湪鍖呭惈 鎺у埗鍣ㄧ被鏂囦欢鐨勭洰褰曚笅闈€
CExtController鐨勪富瑕佺洰鐨勬槸閲嶅畾涔viewPath灞炴 浠ヨ嚧浜庡畠鑳芥寚鍚戔渧iews鈥濆瓙鐩綍瀹冨湪鍖呭惈 鎺у埗鍣ㄧ被鏂囦欢鐨勭洰褰曚笅闈€
鍏叡灞炴
灞炴 | 绫诲瀷 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|---|
action | CAction | the action currently being executed, null if no active action. | CController |
actionParams | array | Returns the request parameters that will be used for action parameter binding. | CController |
cachingStack | CStack | stack of COutputCache objects | CController |
clips | CMap | Returns the list of clips. | CController |
defaultAction | string | the name of the default action. | CController |
id | string | ID of the controller | CController |
layout | mixed | the name of the layout to be applied to this controller's views. | CController |
module | CWebModule | the module that this controller belongs to. | CController |
pageTitle | string | the page title. | CController |
route | string | the route (module ID, controller ID and action ID) of the current request. | CController |
uniqueId | string | the controller ID that is prefixed with the module ID (if any). | CController |
viewPath | string | 杩斿洖鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 | CExtController |
鍏叡鏂规硶
鏂规硶 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|
__call() | 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 | CComponent |
__construct() | CController | |
__get() | 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 | CComponent |
__isset() | 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 | CComponent |
__set() | 璁剧疆涓涓粍浠剁殑灞炴у笺 | CComponent |
__unset() | 璁剧疆涓涓粍浠剁殑灞炴т负null銆 | CComponent |
accessRules() | Returns the access rules for this controller. | CController |
actions() | Returns a list of external action classes. | CController |
asa() | 杩斿洖杩欎釜鍚嶅瓧鐨勮涓哄璞° | CComponent |
attachBehavior() | 闄勫姞涓涓涓哄埌缁勪欢銆 | CComponent |
attachBehaviors() | 闄勫姞涓涓涓哄垪琛ㄥ埌缁勪欢銆 | CComponent |
attachEventHandler() | 涓轰簨浠堕檮鍔犱竴涓簨浠跺鐞嗙▼搴忋 | CComponent |
beginCache() | Begins fragment caching. | CBaseController |
beginClip() | Begins recording a clip. | CBaseController |
beginContent() | Begins the rendering of content that is to be decorated by the specified view. | CBaseController |
beginWidget() | Creates a widget and executes it. | CBaseController |
behaviors() | Returns a list of behaviors that this controller should behave as. | CController |
canGetProperty() | 纭畾灞炴ф槸鍚﹀彲璇汇 | CComponent |
canSetProperty() | 纭畾灞炴ф槸鍚﹀彲鍐欍 | CComponent |
clearPageStates() | Removes all page states. | CController |
createAbsoluteUrl() | Creates an absolute URL for the specified action defined in this controller. | CController |
createAction() | Creates the action instance based on the action name. | CController |
createUrl() | Creates a relative URL for the specified action defined in this controller. | CController |
createWidget() | Creates a widget and initializes it. | CBaseController |
detachBehavior() | 浠庣粍浠朵腑鍒嗙涓涓涓恒 | CComponent |
detachBehaviors() | 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 | CComponent |
detachEventHandler() | 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 | CComponent |
disableBehavior() | 绂佺敤涓涓檮鍔犺涓恒 | CComponent |
disableBehaviors() | 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 | CComponent |
enableBehavior() | 鍚敤涓涓檮鍔犺涓恒 | CComponent |
enableBehaviors() | 鍚敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 | CComponent |
endCache() | Ends fragment caching. | CBaseController |
endClip() | Ends recording a clip. | CBaseController |
endContent() | Ends the rendering of content. | CBaseController |
endWidget() | Ends the execution of the named widget. | CBaseController |
evaluateExpression() | 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 | CComponent |
filterAccessControl() | The filter method for 'accessControl' filter. | CController |
filterAjaxOnly() | The filter method for 'ajaxOnly' filter. | CController |
filterPostOnly() | The filter method for 'postOnly' filter. | CController |
filters() | Returns the filter configurations. | CController |
forward() | Processes the request using another controller action. | CController |
getAction() | 杩斿洖the action currently being executed, null if no active action. | CController |
getActionParams() | Returns the request parameters that will be used for action parameter binding. | CController |
getCachingStack() | 杩斿洖stack of COutputCache objects | CController |
getClips() | Returns the list of clips. | CController |
getEventHandlers() | 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 | CComponent |
getId() | 杩斿洖ID of the controller | CController |
getLayoutFile() | Looks for the layout view script based on the layout name. | CController |
getModule() | 杩斿洖the module that this controller belongs to. It returns null if the controller does not belong to any module | CController |
getPageState() | Returns a persistent page state value. | CController |
getPageTitle() | 杩斿洖the page title. Defaults to the controller name and the action name. | CController |
getRoute() | 杩斿洖the route (module ID, controller ID and action ID) of the current request. | CController |
getUniqueId() | 杩斿洖the controller ID that is prefixed with the module ID (if any). | CController |
getViewFile() | Looks for the view file according to the given view name. | CController |
getViewPath() | 杩斿洖鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 | CExtController |
hasEvent() | 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 | CComponent |
hasEventHandler() | 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 | CComponent |
hasProperty() | 纭畾灞炴ф槸鍚﹁瀹氫箟銆 | CComponent |
init() | Initializes the controller. | CController |
invalidActionParams() | This method is invoked when the request parameters do not satisfy the requirement of the specified action. | CController |
isCachingStackEmpty() | Returns whether the caching stack is empty. | CController |
missingAction() | Handles the request whose action is not recognized. | CController |
processDynamicOutput() | Postprocesses the dynamic output. | CController |
processOutput() | Postprocesses the output generated by render(). | CController |
raiseEvent() | 鍙戣捣涓涓簨浠躲 | CComponent |
recordCachingAction() | Records a method call when an output cache is in effect. | CController |
redirect() | Redirects the browser to the specified URL or route (controller/action). | CController |
refresh() | Refreshes the current page. | CController |
render() | Renders a view with a layout. | CController |
renderClip() | Renders a named clip with the supplied parameters. | CController |
renderDynamic() | Renders dynamic content returned by the specified callback. | CController |
renderDynamicInternal() | This method is internally used. | CController |
renderFile() | Renders a view file. | CBaseController |
renderInternal() | Renders a view file. | CBaseController |
renderPartial() | Renders a view. | CController |
renderText() | Renders a static text string. | CController |
resolveViewFile() | Finds a view file based on its name. | CController |
run() | Runs the named action. | CController |
runAction() | Runs the action after passing through all filters. | CController |
runActionWithFilters() | Runs an action with the specified filters. | CController |
setAction() | 璁剧疆the action currently being executed. | CController |
setPageState() | Saves a persistent page state value. | CController |
setPageTitle() | 璁剧疆the page title. | CController |
setViewPath() | 璁剧疆鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 | CExtController |
widget() | Creates a widget and executes it. | CBaseController |
鍙椾繚鎶ゆ柟娉
鏂规硶 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|
afterAction() | This method is invoked right after an action is executed. | CController |
afterRender() | This method is invoked after the specified is rendered by calling render(). | CController |
beforeAction() | This method is invoked right before an action is to be executed (after all possible filters.) | CController |
beforeRender() | This method is invoked at the beginning of render(). | CController |
createActionFromMap() | Creates the action instance based on the action map. | CController |
loadPageStates() | Loads page states from a hidden input. | CController |
replaceDynamicOutput() | Replaces the dynamic content placeholders with actual content. | CController |
savePageStates() | Saves page states as a base64 string. | CController |
灞炴ц缁
viewPath
灞炴
杩斿洖鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 杩欎釜鏂规硶閫氳繃鎸囧畾瑙嗗浘璺緞鍒 鈥渧iews鈥濆瓙鐩綍瑕嗙洊鐖剁被瀹炵幇锛 鈥渧iews鈥濆瓙鐩綍鍦ㄥ寘鍚帶鍒跺櫒绫绘枃浠剁殑鐩綍涓嬮潰銆
鏂规硶璇︾粏
getViewPath()
鏂规硶
public string getViewPath()
| ||
{return} | string | 鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 |
婧愮爜锛 framework/web/CExtController.php#37 (鏄剧ず)
public function getViewPath()
{
if($this->_viewPath===null)
{
$class=new ReflectionClass(get_class($this));
$this->_viewPath=dirname($class->getFileName()).DIRECTORY_SEPARATOR.'views';
}
return $this->_viewPath;
}
杩斿洖鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 杩欎釜鏂规硶閫氳繃鎸囧畾瑙嗗浘璺緞鍒 鈥渧iews鈥濆瓙鐩綍瑕嗙洊鐖剁被瀹炵幇锛 鈥渧iews鈥濆瓙鐩綍鍦ㄥ寘鍚帶鍒跺櫒绫绘枃浠剁殑鐩綍涓嬮潰銆
setViewPath()
鏂规硶
public void setViewPath(string $value)
| ||
$value | string | 鍖呭惈杩欎釜鎺у埗鍣ㄧ殑瑙嗗浘鏂囦欢鐨勭洰褰曘 |
婧愮爜锛 framework/web/CExtController.php#50 (鏄剧ず)
public function setViewPath($value)
{
$this->_viewPath=$value;
}