Using the latest 1.2 from the branch I noticed something that can
sometimes trouble an existing application.
When you create a form such as :
$form->create(array('controller' => 'Users', 'action' => 'edit')), the
call to isPost (requestHandler) will return true.
Now doing :
$form->create(array('url' => '/users/edit')), the same call to the
requestHandler isPost will return false, but the isPut will return
true.
You can style pass 'style' => 'post' with the second method and that
will be seen as a "post".
This is coming from the form helper, which set the method as "put"
when no 'action' option is set in the parameter array.
I do not know if component such as "Security" and the require Post is
handling this correctly. Actually no a big deal, but that can make you
searching for a while.
$form->create(array('controller' => 'Users', 'action' => 'edit')), the call to isPost (requestHandler) will return true.
You can style pass 'style' => 'post' with the second method and that will be seen as a "post".
AIM: | theundefined87 |
---|---|
Skype: | TimeFor23 |
Other IM: | felixge.de |
Mobile (USA): | +1 404 3888693 |
Mobile (GER): | +49 162 9391612 |
Twitter: | http://twitter.com/felixge |
You right, if you pass 'type' => 'post', it works (means the
requestHandler->isPost() returns true).
I can confirm that using 'url' => array('controller' => 'Users',
'action' => 'edit'), without 'type', will set the method as "put"..
I have a component that uses requestHandler->isPost(), and was
failing ..
That's the drawback of working with the the branch, in another hand I
learn a lot :-)
Thanks
On Nov 4, 7:45 pm, Felix Geisendörfer <haimu...@gmail.com> wrote:
> > $form->create(array('controller' => 'Users', 'action' => 'edit')), the
> > call to isPost (requestHandler) will return true.
>
> I can confirm that. This may be a bug, I'll ask nate about it. It
> basically happens if you don't give an 'action' parameter.> You can style pass 'style' => 'post' with the second method and that
> > will be seen as a "post".
>
> I doubt this would work. I think you can set 'type' => 'post. to work
> around this.
>
> -- Felix
> --------------------------
> Blogger:http://www.thinkingphp.org/
> Entrepreneur:http://www.posttask.com//-- currently in private beta,
> ask me for invite / password/
> Freelancer:http://www.fg-webdesign.de/
>
> AIM: theundefined87
> Skype: TimeFor23
> Other IM: felixge.de <http://felixge.de/>
On Nov 4, 2:16 pm, francky06l <franckl...@gmail.com> wrote:
> Hi Felix,
>
> You right, if you pass 'type' => 'post', it works (means the
> requestHandler->isPost() returns true).
> I can confirm that using 'url' => array('controller' => 'Users',
> 'action' => 'edit'), without 'type', will set the method as "put"..
> I have a component that uses requestHandler->isPost(), and was
> failing ..
>
> That's the drawback of working with the the branch, in another hand I
> learn a lot :-)
> Thanks
>
> On Nov 4, 7:45 pm, Felix Geisendörfer <haimu...@gmail.com> wrote:
>
> > > $form->create(array('controller' => 'Users', 'action' => 'edit')), the
> > > call to isPost (requestHandler) will return true.
>
> > I can confirm that. This may be a bug, I'll ask nate about it. It
> > basically happens if you don't give an 'action' parameter.> You can style pass 'style' => 'post' with the second method and that
> > > will be seen as a "post".
>
> > I doubt this would work. I think you can set 'type' => 'post. to work
> > around this.
>
> > -- Felix
> > --------------------------
> > Blogger:http://www.thinkingphp.org/
> > Entrepreneur:http://www.posttask.com//--currently in private beta,