/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new StudioRent();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['StudioRent'])) {
         $model->attributes = $_POST['StudioRent'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
 public function actionAddrenttext()
 {
     if (isset($_POST['StudioRent'])) {
         $m = new StudioRent();
         $m->attributes = $_POST['StudioRent'];
         if ($m->save()) {
             $this->redirect('/my/studio/rent');
         }
     }
     $this->render('/studioRent/create', array('model' => Users::model()->findByPk(Yii::app()->user->id), 'texts' => StudioRent::model()->findAllByAttributes(array('uid' => Yii::app()->user->id))));
 }