PresenterInterface
in
Interface PresenterInterface.
The interface for data management via a Web Browser UI using the HTTP GET and POST methods.
Note: If a presenter needs more than one parameter to get URL path information provided by placeholders, in addition to $id, do not implement this interface. But this interface can be a reference because its method names are used in RouteCollection::presenter().
Tags
Table of Contents
- create() : mixed
- Handles a POST request for /.
- delete() : mixed
- Handles a POST request for /$id/delete.
- edit() : mixed
- Handles a GET request for /$id/edit.
- index() : mixed
- Handles a GET request for /.
- new() : mixed
- Handles a GET request for /new.
- remove() : mixed
- Handles a GET request for /$id/remove.
- show() : mixed
- Handles a GET request for /$id.
- update() : mixed
- Handles a POST request for /$id/update.
Methods
create()
Handles a POST request for /.
public
create() : mixed
Common usage: Try to create a new item. On success, redirect to the 'show' or 'edit' method URL. On fail, back to the 'new' method URL.
Tags
Return values
mixed —delete()
Handles a POST request for /$id/delete.
public
delete(string $id) : mixed
Common usage: Try to delete an item based on the $id. On success, go to the 'index' method URL and show a success message. On fail, back to the 'remove' method URL and show the error message.
Parameters
- $id : string
Tags
Return values
mixed —edit()
Handles a GET request for /$id/edit.
public
edit(string $id) : mixed
Common usage: Show a form to edit a specific item based on the $id. The POST action must go to the 'update' method URL.
Parameters
- $id : string
Tags
Return values
mixed —index()
Handles a GET request for /.
public
index() : mixed
Common usage: Show a list of paginated items.
Tags
Return values
mixed —new()
Handles a GET request for /new.
public
new() : mixed
Common usage: Show a form with inputs to create a new item. The POST action must go to the 'create' method URL.
Tags
Return values
mixed —remove()
Handles a GET request for /$id/remove.
public
remove(string $id) : mixed
Common usage: Show an alert message about the item to be deleted based on the $id. The confirmation action must call a POST request to the 'delete' method URL.
Parameters
- $id : string
Tags
Return values
mixed —show()
Handles a GET request for /$id.
public
show(string $id) : mixed
Common usage: Show a specific item based on the $id.
Parameters
- $id : string
Tags
Return values
mixed —update()
Handles a POST request for /$id/update.
public
update(string $id) : mixed
Common usage: Try to update an item based on the $id. After the process, back to the 'edit' method URL and show a message.
Parameters
- $id : string