Ian P. Christian wrote:
> Fabien POTENCIER wrote:
>> Hi Ian,
>>
>> As the form framework is new, some comments:
>>
>> Don't override the bind() method like this. One of the property of the 
>> new framework is a very clear separation between 3 layers:
> 
> I am doing that in my action - but the main issue is that unless I bind 

Sorry,  should have been a little more specific here..

My action consists of this:

class authActions extends sfActions
{
   public function executeLogin($request)
   {
     $form = new LoginForm();

     // allows a username to be passed in the URL as a GET param.
     if ($username = $request->getParameter('login_username'))
     {
       $form->setDefaults( array( 'login_username' => $username));
     }

     // if the form was posted...
     if ($request->isMethod('post'))
     {
       $form->bind(
         array(
           'login_username' => $request->getParameter('login_username'),
           'login_password' => $request->getParameter('login_password'),
         ));

       if ($form->isValid())
       {
         die('merp');
       }
     }
     $this->form = $form;
   }
}



But, as that is the form will error becuase of the CSRF field not being 
bound.

As such, I moved that logic into the  LoginForm class, as notjosh 
suggseted doing in his blog (also stating that that might well not be 
the right way).


-- 

Ian P. Christian ~ http://pookey.co.uk

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

Reply via email to