tirenweb
tirenweb

Reputation: 31709

Trying to join two independent forms

i'm trying to join two independent forms (login and register) in the same page.

My idea is (just looking at the signin form):

form action="php?> echo url_for('@sf_guard_signin') ?>" method="post">

It works, but, for example, if i execute LoginAndRegister and submit incorrectly the signin form and I go to another page and then return to LoginAndRegister, i will find the submiting error messages...

If i execute LoginAndRegister and submit incorrectly the signin form and open another browser tab, i will find the submiting error messages in the signin form of the second tab...

Any idea? any better approach?

Upvotes: 1

Views: 138

Answers (2)

tirenweb
tirenweb

Reputation: 31709

I have it, just writing in the if "request->isMethod('post')":

 public function executeLoginAndRegister(sfWebRequest $request){

    if($request->isMethod('post')){

    $this->form_signin =  $this->getUser()->getAttribute('form_signin');

  }
}

Anyway if my approach has any big error or is not safety i would thank anyone who tell me.

Javi

Upvotes: 1

prodigitalson
prodigitalson

Reputation: 60413

I would just use sfDoctrineApplyPlugin if i were you :)

Upvotes: 1

Related Questions