weixin_33725722 2015-06-01 13:27 采纳率: 0%
浏览 30

在Yii框架中编辑动作

I am working on a web application that allow users to have video conferences. Users are allowed to create video conferences and I want them to be able to also edit the scheduled video conferences but I am having trouble implementing that. Please help.

Edit button in index.php view

 $html .=   CHtml::ajaxLink('Edit',
        Yii::app()->createAbsoluteUrl('videoConference/update/'.$vc->id),
        array(
            'type'=>'post',
            'data' => array('id' =>$vc->id,'type'=>'update'),
        ),
        array( "visible" =>  $ismoderator, 'role' => "button", "class" => "btn btn-info")
    );

Video conference Controller actionUpdate

/**
 * Updates a particular model.
 * If update is successful, the browser will be redirected to the 'view' page.
 * @param integer $id the ID of the model to be updated
 */
public function actionUpdate($id)
{
    $model = $this->loadModel($id);

    if (isset($_POST['VideoConference'])) {
        $model->attributes = $_POST['VideoConference'];
        if ($model->save())
            $this->redirect(array('view', 'id' => $model->id));
    }

    $this->render('edit', array(
        'model' => $model,
    ));

}
  • 写回答

2条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥30 如何降低hdfs中datanode的JVM内存用量
      • ¥20 SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 vue+uniapp
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题
      • ¥15 win11如何运行geoserver