File tree Expand file tree Collapse file tree 3 files changed +37
-5
lines changed Expand file tree Collapse file tree 3 files changed +37
-5
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Swagger \Block ;
7
+
8
+ use Magento \Framework \View \Element \Template ;
9
+
10
+ /**
11
+ * Class Index
12
+ *
13
+ * @api
14
+ */
15
+ class Index extends Template
16
+ {
17
+ /**
18
+ * @return mixed|string
19
+ */
20
+ private function getParamStore ()
21
+ {
22
+ return $ this ->getRequest ()->getParam ('store ' ) ?: 'all ' ;
23
+ }
24
+
25
+ /**
26
+ * @return string
27
+ */
28
+ public function getSchemaUrl ()
29
+ {
30
+ return rtrim ($ this ->getBaseUrl (), '/ ' ) . '/rest/ ' . $ this ->getParamStore () . '/schema?services=all ' ;
31
+ }
32
+ }
Original file line number Diff line number Diff line change 41
41
<referenceContainer name =" page.wrapper" remove =" true" />
42
42
<referenceBlock name =" requirejs-config" remove =" true" />
43
43
<referenceContainer name =" root" >
44
- <block name =" swaggerUiContent" class =" Magento\Framework\View\Element\Template " template =" Magento_Swagger::swagger-ui/index.phtml" />
44
+ <block name =" swaggerUiContent" class =" Magento\Swagger\Block\Index " template =" Magento_Swagger::swagger-ui/index.phtml" />
45
45
</referenceContainer >
46
46
</body >
47
47
</page >
Original file line number Diff line number Diff line change 9
9
*
10
10
* The original name of this file, as part of the swagger-ui package, was dist/index.html.
11
11
*
12
- * Modified by Magento, Modifications Copyright © Magento, Inc.
12
+ * Modified by Magento, Modifications Copyright © Magento, Inc. All rights reserved.
13
13
*/
14
14
15
- /** @var \Magento\Framework\View\Element\Template $block */
15
+ /** @var \Magento\Swagger\Block\Index $block */
16
16
17
- $ schemaUrl = rtrim ( $ block ->getBaseUrl (), ' / ' ) . ' /rest/default/schema?services=all ' ;
17
+ $ schemaUrl = $ block ->getSchemaUrl () ;
18
18
?>
19
19
20
20
<div id='header'>
21
21
<div class="swagger-ui-wrap">
22
22
<a id="logo" href="http://swagger.io">swagger</a>
23
23
<form id='api_selector'>
24
- <input id="input_baseUrl" type="hidden" value="<?php /* @escapeNotVerified */ echo $ schemaUrl ?> "/>
24
+ <input id="input_baseUrl" type="hidden" value="<?= /* @escapeNotVerified */ $ schemaUrl ?> "/>
25
25
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
26
26
<div class='input'><a id="explore" href="#" data-sw-translate>apply</a></div>
27
27
</form>
You can’t perform that action at this time.
0 commit comments