123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- include_once dirname(__FILE__) . '/../../../App/Services/AppServer.php';
- include_once dirname(__FILE__) . '/../../../App/Services/TestServer.php';
- ?>
- <html>
- <?php require_once dirname(__FILE__) . '/head.inc.tpl'; ?>
- <script type="text/javascript">
- function updateCallDialog(class_Name, method, params) {
- $("#className").text(method + " methond on " + class_Name);
- $("#myform").attr("action", "?go=index.php&do=call&className=" + class_Name + "&method=" + method);
- $("#args").empty();
- for (arg in params) {
- $("#args").append('<tr><td>' + params[arg].name + '</td><td><input name="' + params[arg].name + '"></td></tr>');
- }
- $("#result").empty();
- // $("#myform").one("submit",null,null,postCallParams);
- }
- ;
- function postCallParams() {
- var form = $("#myform");
- var url = form.attr("action");
- var data = form.serialize();
- $.ajax({
- type: "post",
- url: url,
- data: data,
- success: function (resp) {
- $("#result").html(resp);
- },
- error: function () {
- alert("err");
- }
- });
- return false; // 阻止表单自动提交事件
- }
- ;
- </script>
- <body>
- <?php require_once __DIR__ . '/header.tpl'; ?>
- <div id='main'>
- <div class="left">
- <b> 测试</b>
- <div class="menu">
- <?php
- ob_start();
- Debug::listMethod('loyalsof\AppServer');
- Debug::listMethod('loyalsoft\TestServer');
- ob_end_flush();
- ?>
- </div>
- </div>
- <div style="position: relative; top: 0px;clear: right;" class="userInput" id="callDialog">
- <h3><b id="className">api method on AppServer service</b></h3>
- 复杂参数, 请使用RequestVo的JSON编码格式.
- <form id="myform" action="?go=index.php&do=call" method="POST">
- <table>
- <tbody id="args">
- <tr><td>request</td><td><input name="request" /></td></tr>
- </tbody>
- </table>
- <input type="button" value="Call method »" onclick="postCallParams();" />
- </form>
-
- <div style="position: relative; top: 0px;display: inline-block;float: none;" id="result" >
- </div>
- </div>
-
- </div>
- <?php require_once __DIR__ . '/footer.tpl'; ?>
- </body>
- </html>
|