Advertisement
fernandezekiel

Untitled

May 12th, 2013
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. public function actionCreate()
  2.     {
  3.         $model=new CrossWork;
  4.                 $showSourceOwnerList = true;
  5.         // Uncomment the following line if AJAX validation is needed
  6.         // $this->performAjaxValidation($model);
  7.                 if(!Yii::app()->user->checkAccess('create.any.crosswork')){
  8.                     $model->source_owner_id = Yii::app()->user->id;
  9.                     $showSourceOwnerList = false;
  10.                 }
  11.         if(isset($_POST['CrossWork']))
  12.         {
  13.             $model->attributes=$_POST['CrossWork'];
  14.             if($model->save())
  15.                 $this->redirect(array('view','id'=>$model->id));
  16.         }
  17.  
  18.         $this->render('create',array(
  19.             'model'=>$model,
  20.                         'showSourceOwnerList'=>$showSourceOwnerList,
  21.                    
  22.         ));
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement