本文整理汇总了PHP中api::handleRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP api::handleRequest方法的具体用法?PHP api::handleRequest怎么用?PHP api::handleRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api
的用法示例。
在下文中一共展示了api::handleRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api
<?php
define("PAGE_PUBLIC", true);
require_once 'init.php';
$key = null;
if (isset($_GET['key'])) {
$key = $_GET['key'];
}
$api = new api($app, $key);
if (isset($_GET['method'])) {
$api->handleRequest($_GET['method'], $_GET);
} else {
$api->respond(400);
}
示例2: header
<?php
define("PAGE_PUBLIC", true);
define("LANDING_PAGE", true);
require_once 'init.php';
$minifier->add_file('home.scss', 'css');
// Set canonical link
$app->page->canonical = "https://www.hackthis.co.uk";
if (isset($_GET['api']) && isset($_GET['key'])) {
header("Content-type: text/plain");
// Make call to api
try {
$api = new api($app, $_GET['key']);
$api->handleRequest($_POST['action'], null);
} catch (Exception $e) {
echo $e->getMessage();
}
die;
}
if ($app->user->loggedIn) {
require_once "home.php";
} else {
define("_SIDEBAR", false);
require_once 'header.php';
?>
<div class='row header'>
<img src="https://hackthis-10af.kxcdn.com/files/images/logo_landing.png" alt="HackThis!! - The hackers playground">
</div>
<?php
if (isset($_GET['deleted'])) {
$app->utils->message('Your account has been successfully deleted. Painful though parting be, I bow to you as I see you off to distant clouds. ', 'info');