Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F298896
MethodController.pike
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Dec 25 2024, 8:48 PM
Size
679 B
Mime Type
text/plain
Expires
Fri, Dec 27, 8:48 PM (4 w, 9 h ago)
Engine
blob
Format
Raw Data
Handle
61194
Attached To
R148 fins
MethodController.pike
View Options
//! A controller that implements an endpoint with each method type being handled by
//! a particular handler function
//!
//! @example
//!
//! void method_post(Fins.Request request, Fins.Response response, mixed ... args)
//! {
//! }
//!
inherit
Fins
.
FinsController
;
public
void
index
(
Fins
.
Request
request
,
Fins
.
Response
response
,
mixed
...
args
)
{
string
method
=
request
->
method
;
if
(
!
method
)
method
=
"GET"
;
method
=
lower_case
(
method
);
mixed
fx
;
method
=
"method_"
+
method
;
if
(
fx
=
::
`
[](
method
,
3
))
{
if
(
objectp
(
fx
)
||
functionp
(
fx
))
{
fx
(
request
,
response
,
@
args
);
return
;
}
}
response
->
not_implemented
();
return
;
}
Event Timeline
Log In to Comment