MediaWiki master
FormlessAction.php
Go to the documentation of this file.
1<?php
10namespace MediaWiki\Actions;
11
19abstract class FormlessAction extends Action {
20
26 abstract public function onView();
27
31 public function show() {
32 $this->setHeaders();
33
34 // This will throw exceptions if there's a problem
35 $this->checkCanExecute( $this->getUser() );
36
37 $this->getOutput()->addHTML( $this->onView() );
38 }
39}
40
42class_alias( FormlessAction::class, 'FormlessAction' );
Actions are things which can be done to pages (edit, delete, rollback, etc).
Definition Action.php:53
setHeaders()
Set output headers for noindexing etc.
Definition Action.php:407
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:153
checkCanExecute(User $user)
Checks if the given user (identified by an object) can perform this action.
Definition Action.php:327
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:143
An action which just does something, without showing a form first.
onView()
Show something on GET request.