RESTful PRG

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RESTful PRG

David Muir-2
Does the PRG plugin work with the AbstractRestfulController?

Basically I'm trying to use the same setup to act as a json api as well
as the primary html interface to the application. I was going to set up
a listener to update the http method to PUT or DELETE depending on a
METHOD query parameter. But that means PRG won't work for those
requests, because it would no longer be a POST request.

I'm wanting to use PRG so that users don't get hit with the dreaded "Are
you sure you want to resubmit the form?" alerts.

Am I going about this all wrong?

Cheers,
David

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: RESTful PRG

weierophinney
Administrator
On Mon, Oct 21, 2013 at 1:03 AM, David Muir <[hidden email]> wrote:
> Does the PRG plugin work with the AbstractRestfulController?
>
> Basically I'm trying to use the same setup to act as a json api as well as
> the primary html interface to the application. I was going to set up a
> listener to update the http method to PUT or DELETE depending on a METHOD
> query parameter. But that means PRG won't work for those requests, because
> it would no longer be a POST request.

Most likely it will not work in this situation, unless the originating
method is POST and the target method is GET, as I believe that the
methods are hard-coded into the plugin. You'll likely want to create
an extension to that plugin, or a custom plugin, for this.


--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]