Open kkeiper1103 opened 9 years ago
Hi @kkeiper1103
You can add extra requests like:
'get' => [
'edit' => __NAMESPACE__ . '\\Controllers\\SetController@show',
'delete' => __NAMESPACE__ . '\\Controllers\\SetController@getDestroy',
],
'post' => [
'uses' => __NAMESPACE__ . '\\Controllers\\SetsController@store',
'edit' => __NAMESPACE__ . '\\Controllers\\SetController@update',
'delete' => __NAMESPACE__ . '\\Controllers\\SetController@postDestroy',
]
or
'post.add' => __NAMESPACE__.'\Controllers\AdminController@add',
'post.delete' => __NAMESPACE__.'\Controllers\AdminController@delete',
post.uses
is the standard post request, if you want to set an action &action=update
then you would use post.update
. If you want set fake a method, for example trigger a post
panel using get
you can add &_method=POST
.
Check out the example plugin: https://github.com/getherbert/example-plugin/blob/master/app/panels.php or: https://github.com/bigbitecreative/wordpress-socializr/blob/master/bootstrap/panels.php
Hey, Awesome! Works like a charm; I'll be sure to check out the example plugin too.
On Thu, Jul 9, 2015 at 8:43 AM, Jason Agnew notifications@github.com wrote:
Hi @kkeiper1103 https://github.com/kkeiper1103
You can add extra requests like:
'get' => [ 'edit' => __NAMESPACE__ . '\\Controllers\\SetController@show', 'delete' => __NAMESPACE__ . '\\Controllers\\SetController@getDestroy', ], 'post' => [ 'uses' => __NAMESPACE__ . '\\Controllers\\SetsController@store', 'edit' => __NAMESPACE__ . '\\Controllers\\SetController@update', 'delete' => __NAMESPACE__ . '\\Controllers\\SetController@postDestroy', ]or 'post.add' => __NAMESPACE__.'\Controllers\AdminController@add', 'post.delete' => __NAMESPACE__.'\Controllers\AdminController@delete',
post.uses is the standard post request, if you want to set an action &action=update then you would use post.update. If you want set fake a method, for example trigger a post panel using get you can add &_method=POST.
Check out the example plugin: https://github.com/getherbert/example-plugin/blob/master/app/panels.php or: https://github.com/bigbitecreative/wordpress-socializr/blob/master/bootstrap/panels.php
— Reply to this email directly or view it on GitHub https://github.com/getherbert/herbert/issues/49#issuecomment-119949023.
I'm using the panels feature like this:
The method exposes a form for uploading a spreadsheet that will be imported into the database. How do I register a method to handle a POST request to that panel?
If I'm doing it wrong, please tell me what the official way to do this is.