PresenterInterface interface
Framework\Routing\PresenterInterface
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
{@see RouteCollection::presenter()}.
Defined in libraries/routing/src/PresenterInterface.php
Methods #
- create()
- Handles a POST request for /.
- delete()
- Handles a POST request for /$id/delete.
- edit()
- Handles a GET request for /$id/edit.
- index()
- Handles a GET request for /.
- new()
- Handles a GET request for /new.
- remove()
- Handles a GET request for /$id/remove.
- show()
- Handles a GET request for /$id.
- update()
- Handles a POST request for /$id/update.
create()
Handles a POST request for /.
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.
delete()
Handles a POST request for /$id/delete.
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.
- string $id
edit()
Handles a GET request for /$id/edit.
Common usage: Show a form to edit a specific item based on the $id.
The POST action must go to the 'update' method URL.
- string $id
index()
Handles a GET request for /.
Common usage: Show a list of paginated items.
new()
Handles a GET request for /new.
Common usage: Show a form with inputs to create a new item.
The POST action must go to the 'create' method URL.
remove()
Handles a GET request for /$id/remove.
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.
- string $id
show()
Handles a GET request for /$id.
Common usage: Show a specific item based on the $id.
- string $id
update()
Handles a POST request for /$id/update.
Common usage: Try to update an item based on the $id. After the process, back
to the 'edit' method URL and show a message.
- string $id