コード例 #1
0
 /**
  * Creates a new Empresa model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Empresa();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     //
     $Empresa = new Empresa();
     $Empresa->Nit = $request->Nit;
     $Empresa->Nombre = $request->Nombre;
     $Empresa->Correo = $request->Correo;
     $Empresa->Direccion = $request->Direccion;
     $Empresa->Telefono = $request->Telefono;
     $Empresa->Localidad = $request->Localidad;
     $Empresa->save();
     return redirect('Empresa');
 }