controllers/BannerController.php
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        
		$model->tags = !empty($model->tags)?explode(",",$model->tags):[];
		
		$post = Yii::$app->request->post();
		if (isset($post['Banner']['tags']))
		{
			if (is_array($post['Banner']['tags']))
			{
				$post['Banner']['tags'] = implode(",",$post['Banner']['tags']);
			}	
		}
		
		$transaction = Yii::$app->db->beginTransaction();
		try {				
			if ($model->load($post) && $model->save()) {
				$model->updatePosition($model->position);
				$transaction->commit();
				return $this->redirect(['view', 'id' => $model->id]);
			}					
			else
			{
				$transaction->rollBack();	
			}
		} catch (Exception $e) {
			$transaction->rollBack();
		}
		        
		return $this->render('update', [
			'model' => $model,
		]);
	
    }
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        
		$model->tags = !empty($model->tags)?explode(",",$model->tags):[];
		
		$post = Yii::$app->request->post();
		if (isset($post['Banner']['tags']))
		{
			if (is_array($post['Banner']['tags']))
			{
				$post['Banner']['tags'] = implode(",",$post['Banner']['tags']);
			}	
		}
		
		$transaction = Yii::$app->db->beginTransaction();
		try {				
			if ($model->load($post) && $model->save()) {
				$model->updatePosition($model->position);
				$transaction->commit();
				return $this->redirect(['view', 'id' => $model->id]);
			}					
			else
			{
				$transaction->rollBack();	
			}
		} catch (Exception $e) {
			$transaction->rollBack();
		}
		        
		return $this->render('update', [
			'model' => $model,
		]);
	
    }
Updates an existing Banner model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed