This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
sandpiper/AbstractAction.php

25 lines
463 B
PHP
Raw Permalink Normal View History

<?php
namespace Sandpiper;
abstract class AbstractAction
{
public abstract function handle();
public function get_request_method() {
return strtolower($_SERVER["REQUEST_METHOD"]);
}
public function param_exists($key) {
return !empty($_GET[$key]);
}
public function param_get($key, $default_value) {
return $_GET[$key] ?? $default_value;
}
public function get_post_body() {
return file_get_contents("php://input");
}
}