MediaWiki
REL1_34
HelloHandler.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\Rest\Handler
;
4
5
use
Wikimedia\ParamValidator\ParamValidator
;
6
use
MediaWiki\Rest\SimpleHandler
;
7
12
class
HelloHandler
extends
SimpleHandler
{
13
public
function
run
( $name ) {
14
return
[
'message'
=>
"Hello, $name!"
];
15
}
16
17
public
function
needsWriteAccess
() {
18
return
false
;
19
}
20
21
public
function
getParamSettings
() {
22
return
[
23
'name'
=> [
24
self::PARAM_SOURCE =>
'path'
,
25
ParamValidator::PARAM_TYPE =>
'string'
,
26
ParamValidator::PARAM_REQUIRED =>
true
,
27
],
28
];
29
}
30
}
MediaWiki\Rest\Handler\HelloHandler
Example handler @unstable.
Definition
HelloHandler.php:12
MediaWiki\Rest\Handler\HelloHandler\run
run( $name)
Definition
HelloHandler.php:13
MediaWiki\Rest\Handler\HelloHandler\needsWriteAccess
needsWriteAccess()
Indicates whether this route requires write access.
Definition
HelloHandler.php:17
MediaWiki\Rest\Handler\HelloHandler\getParamSettings
getParamSettings()
Fetch ParamValidator settings for parameters.
Definition
HelloHandler.php:21
MediaWiki\Rest\SimpleHandler
Definition
SimpleHandler.php:15
Wikimedia\ParamValidator\ParamValidator
Service for formatting and validating API parameters.
Definition
ParamValidator.php:38
MediaWiki\Rest\Handler
Definition
HelloHandler.php:3
includes
Rest
Handler
HelloHandler.php
Generated on Fri Apr 5 2024 23:10:25 for MediaWiki by
1.9.8