Hi again,

I have a new way. This time the form is not processed by the component but by the action, so no problem this time to use redirect(). What's your opinion?

modules/miembros/actions/actions.class.php

|public  function  executeAux(sfWebRequest $request)
{
    return  $this->renderPartial('aux');
}
|

modules/miembros/templates/_aux.php

|if(!isset($form_register)){

    $form_register=  new  sfGuardFormRegisterByOthers();
}

include_partial('sfGuardRegister/register',  array('form'  =>  $form_register));


if(!isset($form_signin)){

    $form_signin=  new  sfGuardFormSigninByEmail();
}

include_partial('sfGuardAuth/signin',  array('form'  =>  $form_signin));
|

modules/sfGuardAuth/templates/_signin

|<form action="<?php echo url_for('sfGuardAuth/signin')  ?>" method="post">
|

modules/miembros/sfGuardAuth/actions.class.php

|  if  ($this->form->isValid())
 {
   //...

 }else{

    return  $this->renderPartial('miembros/aux',  array('form_signin'  =>  
$this->form));

 }
|

Javi




On 04/23/2010 11:43 AM, Poltasi Risom wrote:
Yes, component template is as you described (is showing aside)
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'] ?>
...
but when you failed to login action would show the form in the main
area

On Apr 22, 10:39 pm, Javier Garcia<[email protected]>  wrote:
On Apr 22, 7:45 pm, Poltasi Risom<[email protected]>  wrote:

modules/user/actions/components.class.php
...
public function executeShowLoginForm(){
   $this->loginForm = new SigninForm();}
modules/user/actions/actions.class.php
...
public function executeSignin( sfWebRequest $request ){
    $this->form = new SigninForm();
But that way you are creating two forms..I don't understand exactly
your way..could paste the templates of those two, please ??

This below was my attempt. As i said before it doesn't work because
the components don't have the redirect() method...

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->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'] ?>
...

Javi

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group 
athttp://groups.google.com/group/symfony-users?hl=en


--
Javi

Ubuntu 8.04

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to