webyjh
对啊,我就是这么处理的
- webyjh 回复了话题 我写的一个简单的跳转按钮代码
非常感谢您的指点.明白啦
- webyjh 发布了话题我写的一个简单的跳转按钮代码
<div class="row buttons"> <?php echo CHtml::ajaxButton($model->isNewRecord ? '新增记录' : '保存修改',array('records/create'),array ('type'=>'POST','success'=>'function(html){if(html=="success"){alert("成功 ^0^ ")}else{alert("失败 T.T ")}}' )); ?> </div> public function actionCreate() { $model=new Records; // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if(isset($_POST['Records'])) { $model->attributes=$_POST['Records']; if($model->save()){ echo 'success'; }else{ echo 'fail'; } Yii::app()->end(); //$this->redirect(array('create')); //echo '<script>alert("123");</script>'; } $this->render('create',array( 'model'=>$model,)); }
舰长V5,解惑了
- webyjh 回复了话题 你说,这个update权限应该不应该给?
兄弟和我想的一样,现在就是这样做的
- webyjh 回复了话题 你说,这个update权限应该不应该给?
这种情况使用module分离一下,是不是更好一些?
很好,多谢楼主分享!