Exemplo n.º 1
0
 /**
  * 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);
     $oAclRota = new AclRota();
     $oAclTipoUsuarioRota = new AclTipoUsuarioRota();
     $oAclTipoUsuarioRota->acl_tipo_usuario_id = $id;
     if (isset($_POST['AclTipoUsuario'])) {
         $model->attributes = $_POST['AclTipoUsuario'];
         if ($model->save()) {
             $oAclTipoUsuarioRota->salvarTipoUsuarioRotas($_POST);
         }
         $this->redirect(array('view', 'id' => $model->id));
     }
     $this->render('update', array('model' => $model, 'aAclRotas' => $oAclRota->getAclRotasArray(), 'aAclTipoUsuarioRotas' => $oAclTipoUsuarioRota->retornaRotasPorTipoUsuario()));
 }