controllers/MedicamentosController.php
/**
     * Creates a new Medicamentos model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Medicamentos model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Medicamentos model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Medicamentos();
        if ($model->load(Yii::$app->request->post())) {
            $model->pacientes_id = Yii::$app->session['idPaciente'];
            $model->users_id = Yii::$app->user->identity->id;
            $model->save();
            return $this->redirect(['base']);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Medicamentos ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { $ model -> pacientes_id = Yii :: $ app -> session [ 'idPaciente' ] ; $ model -> users_id = Yii :: $ app -> user -> identity -> id ; $ model -> save ( ) ; return $ this -> redirect ( [ 'base' ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Medicamentos model.
Creates a new Medicamentos model .