CCodeForm
鍖 | system.gii |
---|---|
缁ф壙 | class CCodeForm » CActiveForm » CWidget » CBaseController » CComponent |
婧愯嚜 | 1.1.2 |
鐗堟湰 | $Id: CCodeForm.php 2799 2011-01-01 19:31:13Z qiang.xue $ |
婧愮爜 | framework/gii/CCodeForm.php |
CCodeForm琛ㄧず涓涓敤鏉ユ敹闆嗙敓鎴愪唬鐮佹墍闇鍙傛暟鐨勮〃鍗曘
鍏叡灞炴
灞炴 | 绫诲瀷 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|---|
action | mixed | 琛ㄥ崟鍔ㄤ綔鐨刄RL (鍙傝CHtml::normalizeUrl浠ヤ簡瑙f洿澶氬叧浜庢鍙傛暟鐨勭粏鑺)銆 濡傛灉鏈缃紝灏嗕娇鐢ㄥ綋鍓嶉〉闈㈢殑URL銆 | CActiveForm |
actionPrefix | string | actions鐨処D鐨勫墠缂銆 褰撳井浠跺湪CController::actions涓0鏄庝簡 鍔ㄤ綔鎻愪緵鑰咃紝鍙互涓哄叾鍔ㄤ綔鐨処D鎸囧畾鍓嶇紑浠ュ尯鍒 浜庡埆鐨勫井浠舵垨鎺у埗鍣ㄣ傚綋寰欢鐢ㄤ簬鎺у埗鍣 鐨勮鍥句腑鏃讹紝蹇呴』閰嶇疆鍚屾牱鐨勫墠缂銆 | CWidget |
clientOptions | array | 浼犻掔粰JavaScript楠岃瘉鎻掍欢鐨勯夐」鏁扮粍銆
鐩墠鏀寔涓嬪垪閫夐」锛
|
CActiveForm |
controller | CController | 杩斿洖姝ゅ井浠舵墍灞炵殑鎺у埗鍣ㄣ | CWidget |
enableAjaxValidation | boolean | 鏄惁浣垮熀浜嶢JAX鐨勯獙璇佸彲鐢ㄣ傞粯璁ゅ兼槸false銆
褰撴灞炴ц缃负true锛屼綘搴斿綋璞′笅闈㈣繖鏍峰湪鏈嶅姟鍣ㄧ瀵笰JAX楠岃瘉璇锋眰浣滃嚭鍝嶅簲锛
public function actionCreate() { $model=new User; if(isset($_POST['ajax']) && $_POST['ajax']==='user-form') { echo CActiveForm::validate($model); Yii::app()->end(); } . |
CActiveForm |
enableClientValidation | boolean | 鏄惁浣垮鎴风楠岃瘉鍙敤銆傞粯璁ゅ兼槸false銆
褰撴灞炴ц缃负true锛屾敮鎸佸畠鐨勯獙璇佸櫒灏嗘墽琛屽鎴风楠岃瘉銆 锛堝弬瑙CValidator::enableClientValidation鍜CValidator::clientValidateAttribute銆傦級 |
CActiveForm |
errorMessageCssClass | string | 閿欒淇℃伅鐨凜SS绫汇傞粯璁ゅ兼槸鈥渆rrorMessage鈥濄 涓綋鐨error璋冪敤鍙互閫氳繃鎸囧畾鈥渃lass鈥滺TML閫夐」鏉ヨ鐩栬繖涓笺 | CActiveForm |
focus | mixed | 椤甸潰杞藉叆鏃跺垵濮嬪寲鑾峰彇杈撳叆鐒︾偣鐨勮〃鍗曞厓绱犮
榛樿鍊兼槸null锛岃〃绀烘病鏈夎緭鍏ュ煙鎷ユ湁鐒︾偣銆 濡傛灉璁剧疆涓烘暟缁勶紝绗竴涓厓绱犳槸妯″瀷锛岀浜屼釜鍏冪礌鏄睘鎬с 濡傛灉璁剧疆涓哄瓧绗︿覆锛岄偅涔堝皢浣滀负jQuery鐨勯夋嫨鍣ㄤ娇鐢ㄣ 绀轰緥 - 璁剧疆椤甸潰杞藉叆鏃剁殑杈撳叆鐒︾偣锛
|
CActiveForm |
htmlOptions | array | additional 娓叉煋琛ㄥ崟鏍囩鐨凥TML灞炴с | CActiveForm |
id | string | 杩斿洖姝ゅ井浠剁殑ID銆傚鏋滈渶瑕佺殑璇濓紝灏嗙敓浜т竴涓柊鐨処D骞跺皢鍏惰繑鍥炪 | CWidget |
method | string | 琛ㄥ崟鎻愪氦鐨勬柟寮忋傚彲浠ユ槸鈥減ost鈥濇垨鈥済et鈥濄 榛樿鍊兼槸鈥減ost鈥濄 | CActiveForm |
model | CCodeModel涓庢琛ㄥ崟鐩稿叧鐨勪唬鐮佹ā鍨 | CCodeForm | |
owner | CBaseController | 杩斿洖姝ゅ井浠剁殑鎵鏈夎呮垨鍒涘缓鑰呫 | CWidget |
skin | mixed | 寰欢浣跨敤鐨勭毊鑲ょ殑鍚嶇О銆傞粯璁や负鈥渄efault鈥濄 濡傛灉姝ゅ睘鎬ц缃负false锛屽井浠跺皢涓嶄細鏈夌毊鑲よ浣跨敤銆 | CWidget |
stateful | boolean | 鏄惁鐢熸垚鏈夌姸鎬佺殑琛ㄥ崟锛堝弬瑙CHtml::statefulForm锛夈傞粯璁ゅ兼槸false銆 | CActiveForm |
viewPath | string | 杩斿洖鍖呭惈姝ゅ井浠舵墍闇鐨勮鍥炬枃浠剁殑璺緞銆 | CWidget |
鍙椾繚鎶ゅ睘鎬
灞炴 | 绫诲瀷 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|---|
attributes | array | 鐢ㄤ簬妯″瀷灞炴х殑javascript閫夐」 (input ID => options) | CActiveForm |
summaryID | string | 鍖呭惈姹囨荤殑閿欒淇℃伅鐨勫厓绱犵殑ID | CActiveForm |
鍏叡鏂规硶
鏂规硶 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|
__call() | 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 | CComponent |
__construct() | 鏋勯犲櫒銆 | CWidget |
__get() | 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 | CComponent |
__isset() | 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 | CComponent |
__set() | 璁剧疆涓涓粍浠剁殑灞炴у笺 | CComponent |
__unset() | 璁剧疆涓涓粍浠剁殑灞炴т负null銆 | CComponent |
actions() | 杩斿洖姝idget浣跨敤鐨勫姩浣滅殑鍒楄〃銆 | CWidget |
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 |
canGetProperty() | 纭畾灞炴ф槸鍚﹀彲璇汇 | CComponent |
canSetProperty() | 纭畾灞炴ф槸鍚﹀彲鍐欍 | CComponent |
checkBox() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓閫夋銆 | CActiveForm |
checkBoxList() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓閫夋缁勩 | CActiveForm |
createWidget() | Creates a widget and initializes it. | CBaseController |
detachBehavior() | 浠庣粍浠朵腑鍒嗙涓涓涓恒 | CComponent |
detachBehaviors() | 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 | CComponent |
detachEventHandler() | 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 | CComponent |
disableBehavior() | 绂佺敤涓涓檮鍔犺涓恒 | CComponent |
disableBehaviors() | 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 | CComponent |
dropDownList() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓笅鎷夊垪琛ㄦ銆 | CActiveForm |
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 |
error() | 鏄剧ず涓涓ā鍨嬪睘鎬х殑绗竴涓獙璇侀敊璇 | CActiveForm |
errorSummary() | 鏄剧ず涓涓垨澶氫釜妯″瀷鐨勬眹鎬荤殑楠岃瘉閿欒淇℃伅銆 | CActiveForm |
evaluateExpression() | 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 | CComponent |
fileField() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓枃浠朵笂浼犳帶浠躲 | CActiveForm |
getController() | 杩斿洖姝ゅ井浠舵墍灞炵殑鎺у埗鍣ㄣ | CWidget |
getEventHandlers() | 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 | CComponent |
getId() | 杩斿洖姝ゅ井浠剁殑ID銆傚鏋滈渶瑕佺殑璇濓紝灏嗙敓浜т竴涓柊鐨処D骞跺皢鍏惰繑鍥炪 | CWidget |
getOwner() | 杩斿洖姝ゅ井浠剁殑鎵鏈夎呮垨鍒涘缓鑰呫 | CWidget |
getViewFile() | 鏍规嵁瑙嗗浘鍚嶆煡鎵捐鍥炬枃浠躲 | CWidget |
getViewPath() | 杩斿洖鍖呭惈姝ゅ井浠舵墍闇鐨勮鍥炬枃浠剁殑璺緞銆 | CWidget |
hasEvent() | 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 | CComponent |
hasEventHandler() | 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 | CComponent |
hasProperty() | 纭畾灞炴ф槸鍚﹁瀹氫箟銆 | CComponent |
init() | 鍒濆鍖栨寰欢銆 | CCodeForm |
label() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撳嚭涓涓狧TML Label鏍囩銆 | CActiveForm |
labelEx() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撳嚭涓涓狧TML Label鏍囩銆 | CActiveForm |
listBox() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓垪琛ㄦ銆 | CActiveForm |
passwordField() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓瘑鐮佹銆 | CActiveForm |
radioButton() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓崟閫夋寜閽 | CActiveForm |
radioButtonList() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓崟閫夋寜閽粍銆 | CActiveForm |
raiseEvent() | 鍙戣捣涓涓簨浠躲 | CComponent |
render() | 娓叉煋涓涓鍥俱 | CWidget |
renderFile() | Renders a view file. | CBaseController |
renderInternal() | Renders a view file. | CBaseController |
run() | 杩愯姝ゅ井浠躲 | CCodeForm |
setId() | 璁剧疆姝ゅ井浠剁殑ID銆 | CWidget |
textArea() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓琛岀殑鏂囨湰杈撳叆鎺т欢銆 | CActiveForm |
textField() | 涓轰竴涓ā鍨嬪睘鎬ф覆鏌撲竴涓緭鍏ユ銆 | CActiveForm |
validate() | 楠岃瘉涓涓垨澶氫釜妯″瀷锛屼互JSON鏍煎紡杩斿洖缁撴灉銆 | CActiveForm |
validateTabular() | 楠岃瘉涓涓敱澶氫釜妯″瀷瀹炰緥缁勬垚鐨勬暟缁勶紝骞跺皢楠岃瘉缁撴灉浠SON鏍煎紡杩斿洖銆 | CActiveForm |
widget() | Creates a widget and executes it. | CBaseController |
灞炴ц缁
model
灞炴
public CCodeModel涓庢琛ㄥ崟鐩稿叧鐨勪唬鐮佹ā鍨 $model;
鏂规硶璇︾粏
init()
鏂规硶
public void init()
|
婧愮爜锛 framework/gii/CCodeForm.php#30 (鏄剧ず)
public function init()
{
echo <<<EOD
<div class="form gii">
<p class="note">
Fields with <span class="required">*</span> are required.
Click on the <span class="sticky">highlighted fields</span> to edit them.
</p>
EOD;
parent::init();
}
鍒濆鍖栨寰欢銆 姝ゆ柟娉曟覆鏌撹〃鍗曠殑寮濮嬫爣绛俱
run()
鏂规硶
public void run()
|
婧愮爜锛 framework/gii/CCodeForm.php#45 (鏄剧ず)
public function run()
{
$templates=array();
foreach($this->model->getTemplates() as $i=>$template)
$templates[$i]=basename($template).' ('.$template.')';
$this->renderFile(Yii::getPathOfAlias('gii.views.common.generator').'.php',array(
'model'=>$this->model,
'templates'=>$templates,
));
parent::run();
echo "</div>";
}
杩愯姝ゅ井浠躲