Symfony: joining two forms in the same page
- by user248959
Hi,
i'm trying to join in the same action the login and the register forms. This is what i'm trying:
modules/miembros/actions.class.php
public function executeAux(sfWebRequest $request)
{
// I execute this action
}
modules/miembros/templates/auxSuccess.php
<?php include_component('sfGuardRegister', 'register'); ?>
<?php include_component('sfGuardAuth', 'signin'); ?>
modules/miembros/components.class.php
public function executeSignin($request)
{
if ( $request->isMethod( 'post' ) && ($request-
>getParameter('submit')=='signin') ){
$this->form->bind( $request->getParameter( 'login' ) );
if ( $this->form->isValid() ){
$this->getController()->getActionStack()->getLastEntry()->getActionInstance()->redirect( '@home' );
}
}
}
modules/miembros/templates/_signin.php
<form action="<?php echo url_for('miembros/aux?submit=signin') ?>"
method="post">
<?php echo $form['email_address']->renderLabel() ?>
<?php echo $form['email_address'] ?>
...
It's working ok, but i would to know if you have other alternatives.
Regards
Javi