added version 1.0.0 of APIlite library,
added basic HTML template for help, added test class APIcalculator for demo
This commit is contained in:
37
src/help.tpl.php
Normal file
37
src/help.tpl.php
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo $this->apiName; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1><?php echo $this->apiName; ?></h1>
|
||||
|
||||
<p>API documentation in <a href="<?php echo $this->getCurrentUrl(); ?>?format=json">JSON</a></p>
|
||||
<p>API endpoint URL <a href="<?php echo $this->getCurrentUrl(); ?>"><?php echo $this->getCurrentUrl(); ?></a></p>
|
||||
|
||||
<?php if (is_array($this->methods)) foreach ($this->methods as $index => $method) { ?>
|
||||
|
||||
<h2><?php echo $method['name']; ?></h2>
|
||||
<i><?php echo $method['description']; ?></i>
|
||||
<p>Endpoint URL: <a href="<?php echo $this->getCurrentUrl(); ?>?action=<?php echo $method['name']; ?>"><?php echo $this->getCurrentUrl(); ?>?action=<?php echo $method['name']; ?></a></p>
|
||||
|
||||
<?php if (is_array($method['params'])) foreach ($method['params'] as $param) { ?>
|
||||
|
||||
<p>
|
||||
<?php echo $param['name']; ?>: <code><?php echo $param['type']; ?></code>
|
||||
—
|
||||
<?php
|
||||
if ($param['optional']) echo '(optional) ';
|
||||
echo $param['doc'];
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user