controllers/UseruserController.php
/**
     * Creates a new Useruser model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Useruser model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Useruser model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Useruser();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if ($model->user_id === $model->added_user || $model->user_id === $model->user_id) {
                echo "Ya esta agregado";
            } else {
                return $this->redirect(['view', 'id' => $model->user_id]);
            }
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Useruser ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { if ( $ model -> user_id === $ model -> added_user || $ model -> user_id === $ model -> user_id ) { echo " Ya esta agregado " ; } else { return $ this -> redirect ( [ 'view' , 'id' => $ model -> user_id ] ) ; } } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Useruser model.
Creates a new Useruser model .