刚学, 不是很懂, 请教各位大侠这是什么错?谢谢 [ 新手入门 ]
运行时 报错??
Property "CActiveForm.enableClientValidation" is not defined.
Source File
C:\wamp\www\yii\framework\web\CBaseController.php(146)
00134: * @param array initial property values
00135: * @return CWidget the fully initialized widget instance.
00136: */
00137: public function createWidget($className,$properties=array())
00138: {
00139: if(($factory=Yii::app()->getWidgetFactory())!==null)
00140: $widget=$factory->createWidget($this,$className,$properties);
00141: else
00142: {
00143: $className=Yii::import($className,true);
00144: $widget=new $className($this);
00145: foreach($properties as $name=>$value)
00146: $widget->$name=$value;
00147: }
00148: $widget->init();
00149: return $widget;
00150: }
00151:
00152: /**
这是什么原因? 谢谢各位大侠? 对了有中文的API文档吗? 网上只看到了英文的? 有点话发给地址瞧瞧~~~
共 25 条回复
-
<div class="form" style="width:250px;"> <?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'search_form', 'enableClientValidation'=>true, 'clientOptions'=>array( 'validateOnSubmit'=>true, ), )); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <div class="row"> <?php echo $form->labelEx($model,'user_id'); ?> <?php echo $form->textField($model,'user_id'); ?> <?php echo $form->error($model,'user_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model,'user_email'); ?> <?php echo $form->textField($model,'user_email'); ?> <?php echo $form->error($model,'user_email'); ?> <!--<p class="hint"> Hint: You may login with <tt>demo/demo</tt> or <tt>admin/admin</tt>. </p>--> </div> <div class="row buttons"> <?php echo CHtml::submitButton('Search'); ?> </div> <?php $this->endWidget(); ?>
-
public function actionIndex(){ $model=new SearchForm; $user=new Users; $action=new Actions; $this->layout='search'; // if it is ajax validation request if(isset($_POST['ajax']) && $_POST['ajax']==='search-form') { echo CActiveForm::validate($model); Yii::app()->end(); } if(Yii::app()->request->isPostRequest) { if($_POST['yt0']=='Search') { $user->user_id=$_POST['SearchForm']['user_id']; $user->user_email=$_POST['SearchForm']['user_email']; if(!$user->searchByUserId()){ $action->action_channel="ebay"; $action->action_target="User"; $action->action_process='GetUser'; $action->action_type='REALTIME'; $action->action_params=$action->convertArray2DB(array('user_id'=>$user->user_id)); if($action->save()){ unset($action->action_params); $action->action_params=array('user_id'=>$user->user_id); if ( $this->execute($action->attributes) ) { echo 'Success'; $user->user_id= $_POST['SearchForm']['user_id'] ; $user->searchByUserId(); } else { echo 'Failure'; } } } $userId=$user->user_id; $userEmail=$user->user_email; } } $this->render("index",array('model'=>$model)); }
282414352
注册时间:2011-07-25
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
- 金钱175
- 威望0
- 积分175